]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 169211 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Mon, 19 Jan 2009 15:55:00 +0000 (15:55 +0000)
committerMark Michelson <mmichelson@digium.com>
Mon, 19 Jan 2009 15:55:00 +0000 (15:55 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
r169211 | mmichelson | 2009-01-19 09:54:06 -0600 (Mon, 19 Jan 2009) | 21 lines

Merged revisions 169210 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r169210 | mmichelson | 2009-01-19 09:52:15 -0600 (Mon, 19 Jan 2009) | 13 lines

Prevent a crash in chan_local due to a potential NULL pointer dereference

Move the check for if both channels on a local_pvt have generators to below
where p->chan is checked for NULLity (NULLness?). This prevents a crash from
occurring if p->chan is NULL.

(closes issue #14189)
Reported by: sascha
Patches:
      14189.patch uploaded by putnopvut (license 60)
Tested by: sascha

........

................

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

channels/chan_local.c

index 8de28f773c1dbbce14de076a1973eed283858b6f..d597b01c13020b7d1b0eba0f600436be5abb8b6f 100644 (file)
@@ -175,10 +175,6 @@ static int local_queue_frame(struct local_pvt *p, int isoutbound, struct ast_fra
        /* Recalculate outbound channel */
        other = isoutbound ? p->owner : p->chan;
 
-       /* do not queue frame if generator is on both local channels */
-       if (us && us->generator && other->generator)
-               return 0;
-
        /* Set glare detection */
        ast_set_flag(p, LOCAL_GLARE_DETECT);
        if (ast_test_flag(p, LOCAL_CANCEL_QUEUE)) {
@@ -193,6 +189,10 @@ static int local_queue_frame(struct local_pvt *p, int isoutbound, struct ast_fra
                return 0;
        }
 
+       /* do not queue frame if generator is on both local channels */
+       if (us && us->generator && other->generator)
+               return 0;
+
        /* Ensure that we have both channels locked */
        while (other && ast_channel_trylock(other)) {
                ast_mutex_unlock(&p->lock);