[sr-dev] git:master: modules/sdpops: Check for valid sdp body in sdp_remove_line_by_prefix

Hugh Waite hugh.waite at crocodile-rcs.com
Thu Sep 19 00:34:15 CEST 2013


Module: sip-router
Branch: master
Commit: 771e9093e343951e12f4875692e9ecc567a277a1
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=771e9093e343951e12f4875692e9ecc567a277a1

Author: Hugh Waite <hugh.waite at crocodile-rcs.com>
Committer: Hugh Waite <hugh.waite at crocodile-rcs.com>
Date:   Wed Sep 18 21:34:16 2013 +0100

modules/sdpops: Check for valid sdp body in sdp_remove_line_by_prefix

- Fixes crash when used on requests with no body

---

 modules/sdpops/sdpops_mod.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/sdpops/sdpops_mod.c b/modules/sdpops/sdpops_mod.c
index e11764c..a506fc6 100644
--- a/modules/sdpops/sdpops_mod.c
+++ b/modules/sdpops/sdpops_mod.c
@@ -373,6 +373,11 @@ int sdp_remove_line_by_prefix(sip_msg_t* msg, str* prefix)
 		return -1;
 	}
 
+	if(msg->body == NULL) {
+		LM_DBG("No sdp body\n");
+		return -1;
+	}
+
 	body.s = ((sdp_info_t*)msg->body)->raw_sdp.s;
 	body.len = ((sdp_info_t*)msg->body)->raw_sdp.len;
 




More information about the sr-dev mailing list