]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Check sip_pvt pointer in ast_channel_get_t38_state(c) 90/1790/1
authorFilip Jenicek <phill@janevim.cz>
Tue, 8 Dec 2015 07:57:22 +0000 (08:57 +0100)
committerJoshua Colp <jcolp@digium.com>
Wed, 9 Dec 2015 14:55:15 +0000 (08:55 -0600)
Asterisk may crash when calling ast_channel_get_t38_state(c)
on a locked channel which is being hung up.

ASTERISK-25609 #close

Change-Id: Ifaa707c04b865a290ffab719bd2e5c48ff667c7b

channels/chan_sip.c

index c54224570539fd2d27eee6026aa2e021240cfc45..9bc15bbbcc076a9e1f236f516a518859cb6834e2 100644 (file)
@@ -4752,6 +4752,11 @@ static int sip_queryoption(struct ast_channel *chan, int option, void *data, int
        struct sip_pvt *p = (struct sip_pvt *) ast_channel_tech_pvt(chan);
        char *cp;
 
+       if (!p) {
+               ast_debug(1, "Attempt to Ref a null pointer. Sip private structure is gone!\n");
+               return -1;
+       }
+
        sip_pvt_lock(p);
 
        switch (option) {