[Asterisk-code-review] chan sip: Check sip pvt pointer in ast channel get t38 state(c) (asterisk[11])
Joshua Colp
asteriskteam at digium.com
Wed Dec 9 08:55:21 CST 2015
Joshua Colp has uploaded a new change for review.
https://gerrit.asterisk.org/1791
Change subject: chan_sip: Check sip_pvt pointer in ast_channel_get_t38_state(c)
......................................................................
chan_sip: Check sip_pvt pointer in ast_channel_get_t38_state(c)
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
---
M channels/chan_sip.c
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/91/1791/1
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index b42e625..7f22beb 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4772,6 +4772,11 @@
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) {
--
To view, visit https://gerrit.asterisk.org/1791
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifaa707c04b865a290ffab719bd2e5c48ff667c7b
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Filip Jenicek <phill at janevim.cz>
More information about the asterisk-code-review
mailing list