Module: kamailio Branch: master Commit: 75040f62238d6181dc9aec977588c63d15dc5cbc URL: https://github.com/kamailio/kamailio/commit/75040f62238d6181dc9aec977588c63d...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2018-09-10T08:19:02+02:00
rtpengine: safety check for tm uas.request field
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff: https://github.com/kamailio/kamailio/commit/75040f62238d6181dc9aec977588c63d... Patch: https://github.com/kamailio/kamailio/commit/75040f62238d6181dc9aec977588c63d...
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c index 4187e61a84..e576117c35 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -3310,6 +3310,7 @@ rtpengine_manage(struct sip_msg *msg, const char *flags) { int method; int nosdp; + tm_cell_t *t = NULL;
if (msg->cseq==NULL && ((parse_headers(msg, HDR_CSEQ_F, 0)==-1) || (msg->cseq==NULL))) @@ -3339,9 +3340,12 @@ rtpengine_manage(struct sip_msg *msg, const char *flags) return rtpengine_offer_answer(msg, flags, OP_OFFER, 0); if(method==METHOD_INVITE && nosdp==0) { msg->msg_flags |= FL_SDP_BODY; - if(tmb.t_gett!=NULL && tmb.t_gett()!=NULL - && tmb.t_gett()!=T_UNDEFINED) - tmb.t_gett()->uas.request->msg_flags |= FL_SDP_BODY; + if(tmb.t_gett!=NULL) { + t = tmb.t_gett(); + if(t!=NULL && t!=T_UNDEFINED && t->uas.request!=NULL) { + t->uas.request->msg_flags |= FL_SDP_BODY; + } + } if(route_type==FAILURE_ROUTE) return rtpengine_delete(msg, flags); return rtpengine_offer_answer(msg, flags, OP_OFFER, 0);