Module: kamailio
Branch: master
Commit: cd67fbb8ecb83944f458ec8a127adc14d5b38aeb
URL:
https://github.com/kamailio/kamailio/commit/cd67fbb8ecb83944f458ec8a127adc1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-05-03T10:18:11+02:00
sdpops: safety check if sdp pointer is null inside sdp_get()
---
Modified: modules/sdpops/sdpops_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/cd67fbb8ecb83944f458ec8a127adc1…
Patch:
https://github.com/kamailio/kamailio/commit/cd67fbb8ecb83944f458ec8a127adc1…
---
diff --git a/modules/sdpops/sdpops_mod.c b/modules/sdpops/sdpops_mod.c
index d63cd78..5984332 100644
--- a/modules/sdpops/sdpops_mod.c
+++ b/modules/sdpops/sdpops_mod.c
@@ -1502,14 +1502,15 @@ static int w_sdp_get(sip_msg_t* msg, char *avp)
}
sdp = (sdp_info_t*)msg->body;
- if (sdp_missing) {
+ if (sdp==NULL) {
LM_DBG("No SDP\n");
return -2;
- } else {
- avp_val.s.s = sdp->raw_sdp.s;
- avp_val.s.len = sdp->raw_sdp.len;
- LM_DBG("Found SDP %.*s\n", sdp->raw_sdp.len, sdp->raw_sdp.s);
}
+
+ avp_val.s.s = sdp->raw_sdp.s;
+ avp_val.s.len = sdp->raw_sdp.len;
+ LM_DBG("Found SDP %.*s\n", sdp->raw_sdp.len, sdp->raw_sdp.s);
+
if (add_avp(AVP_VAL_STR | avp_type, avp_name, avp_val) != 0)
{
LM_ERR("Failed to add SDP avp");