aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-17 13:36:07 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-17 13:36:07 +0000
commitf4545de5669523f1a762db383901efbc9cfa565f (patch)
treeb473cb7efa87c912f08a7daa33949cd0ffbd1cde /main
parent2f9d4f5da564b5716be76bed02f75eb176c841e3 (diff)
Merged revisions 287307 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r287307 | mnicholson | 2010-09-17 08:34:34 -0500 (Fri, 17 Sep 2010) | 5 lines Use ast_strdup() instead of ast_strdupa() while processing in ast_hint_state_changed(). (related to issue #17928) Reported by: mdu113 ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@287308 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/pbx.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c
index f5b2aeeb4..7949eb145 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -3866,8 +3866,10 @@ static int handle_statechange(void *datap)
AST_RWLIST_TRAVERSE(&hints, hint, list) {
struct ast_state_cb *cblist;
- char *parse = ast_strdupa(ast_get_extension_app(hint->exten));
- char *cur;
+ /* can't use ast_strdupa() here because we may run out of stack
+ * space while looping over a large number of large strings */
+ char *dup = ast_strdup(ast_get_extension_app(hint->exten));
+ char *cur, *parse = dup;
int state;
while ( (cur = strsep(&parse, "&")) ) {
@@ -3875,6 +3877,9 @@ static int handle_statechange(void *datap)
break;
}
}
+
+ ast_free(dup);
+
if (!cur) {
continue;
}