[sr-dev] git:master:521485c8: nathelper: check length on new condition inside replace_sdp_ip()

Daniel-Constantin Mierla miconda at gmail.com
Tue Jun 15 09:55:35 CEST 2021


Module: kamailio
Branch: master
Commit: 521485c8f25f55cb3045ab2b33232c7026d8527d
URL: https://github.com/kamailio/kamailio/commit/521485c8f25f55cb3045ab2b33232c7026d8527d

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-06-15T09:54:32+02:00

nathelper: check length on new condition inside replace_sdp_ip()

---

Modified: src/modules/nathelper/nathelper.c

---

Diff:  https://github.com/kamailio/kamailio/commit/521485c8f25f55cb3045ab2b33232c7026d8527d.diff
Patch: https://github.com/kamailio/kamailio/commit/521485c8f25f55cb3045ab2b33232c7026d8527d.patch

---

diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c
index 5fb83cea46..df9a5bce2c 100644
--- a/src/modules/nathelper/nathelper.c
+++ b/src/modules/nathelper/nathelper.c
@@ -1696,7 +1696,7 @@ static inline int replace_sdp_ip(
 		hasreplaced = 1;
 		body1 = body2;
 	}
-	if(!hasreplaced && memcmp("a=rtcp", line, 6) != 0) {
+	if(!hasreplaced && linelen>=6 && memcmp("a=rtcp", line, 6)!=0) {
 		LM_ERR("can't extract '%s' IP from the SDP\n", line);
 		return -1;
 	}




More information about the sr-dev mailing list