]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a crash in app_sms.
authorRussell Bryant <russell@russellbryant.com>
Thu, 30 Sep 2010 15:34:29 +0000 (15:34 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 30 Sep 2010 15:34:29 +0000 (15:34 +0000)
Since the data being passed to the generator callback is on the stack of the
SMS() application, we must ensure that the generator is stopped before the
application exits.

ABE-2587

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@289424 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_sms.c

index b1bc849881d25884000ce0532f0b6b0982a0fac0..412ddb0d64f424081175bde6be4d581521dba4e8 100644 (file)
@@ -1506,6 +1506,12 @@ static int sms_exec (struct ast_channel *chan, void *data)
 
        sms_log (&h, '?');                        /* log incomplete message */
 
+       /* 
+        * The SMS generator data is on the stack.  We _MUST_ make sure the generator
+        * is stopped before returning from this function.
+        */
+       ast_deactivate_generator(chan);
+
        ast_module_user_remove(u);
        return (h.err);
 }