]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Checks for NULL sip_pvt pointer in chan_sip.c->acf_channel_read()
authorDavid Brooks <dbrooks@digium.com>
Wed, 17 Jun 2009 18:45:50 +0000 (18:45 +0000)
committerDavid Brooks <dbrooks@digium.com>
Wed, 17 Jun 2009 18:45:50 +0000 (18:45 +0000)
Zombie channels could be passed, and chan_sip.c wasn't checking for it.
Could crash Asterisk. Now checking for NULL pointer.

(closes issue #15330)
Reported by: okrief
Tested by: dbrooks

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

channels/chan_sip.c

index 7b225a6aa4bcc4c53a363000d0e0e73c37b5293d..78709e422e8a8481bbcbe4a31af21672a84a7d47 100644 (file)
@@ -15519,6 +15519,10 @@ static int acf_channel_read(struct ast_channel *chan, char *funcname, char *prep
        memset(buf, 0, buflen);
        memset(&qos, 0, sizeof(qos));
 
+       if (p == NULL) {
+               return -1;
+       }
+
        if (strcasecmp(args.type, "AUDIO") == 0) {
                all = ast_rtp_get_quality(p->rtp, &qos);
        } else if (strcasecmp(args.type, "VIDEO") == 0) {