From: Terry Wilson Date: Thu, 8 Dec 2011 16:20:25 +0000 (+0000) Subject: Don't crash on INFO automon request with no channel X-Git-Tag: 10.1.0-rc1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b20f27d3f07ccd7c10d1c9dddcc3dabab47e7447;p=thirdparty%2Fasterisk.git Don't crash on INFO automon request with no channel AST-2011-014. When automon was enabled in features.conf, it was possible to crash Asterisk by sending an INFO request if no channel had been created yet. (closes issue ASTERISK-18805) ........ Merged revisions 347530 from http://svn.asterisk.org/svn/asterisk/branches/1.6.2 ........ Merged revisions 347531 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@347532 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 7624b42c53..410ffceffe 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -19161,11 +19161,18 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req) per device. I don't want incoming callers to record calls in my pbx. */ - /* first, get the feature string, if it exists */ + struct ast_call_feature *feat; int j; struct ast_frame f = { AST_FRAME_DTMF, }; + if (!p->owner) { /* not a PBX call */ + transmit_response(p, "481 Call leg/transaction does not exist", req); + sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); + return; + } + + /* first, get the feature string, if it exists */ ast_rdlock_call_features(); feat = ast_find_call_feature("automon"); if (!feat || ast_strlen_zero(feat->exten)) {