Make local copy of arguments to parse. (issue #8362 reported by homesick)
authorJoshua Colp <jcolp@digium.com>
Tue, 14 Nov 2006 20:09:10 +0000 (20:09 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 14 Nov 2006 20:09:10 +0000 (20:09 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47623 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c

index 5e63dd4..bb0354f 100644 (file)
@@ -822,14 +822,15 @@ static int valid_priv_reply(struct ast_flags *opts, int res)
 static int do_timelimit(struct ast_channel *chan, struct ast_bridge_config *config,
        char *parse, unsigned int *calldurationlimit)
 {
+       char *stringp = ast_strdupa(parse);
        char *limit_str, *warning_str, *warnfreq_str;
        const char *var;
        int play_to_caller=0,play_to_callee=0;
        int delta;
 
-       limit_str = strsep(&warnfreq_str, ":");
-       warning_str = strsep(&warnfreq_str, ":");
-       warnfreq_str = parse;
+       limit_str = strsep(&stringp, ":");
+       warning_str = strsep(&stringp, ":");
+       warnfreq_str = strsep(&stringp, ":");
 
        config->timelimit = atol(limit_str);
        if (warning_str)