Browse code

nathelper: check length on new condition inside replace_sdp_ip()

(cherry picked from commit 521485c8f25f55cb3045ab2b33232c7026d8527d)

Daniel-Constantin Mierla authored on 15/06/2021 07:54:32
Showing 1 changed files
... ...
@@ -1655,7 +1655,7 @@ static inline int replace_sdp_ip(
1655 1655
 		hasreplaced = 1;
1656 1656
 		body1 = body2;
1657 1657
 	}
1658
-	if(!hasreplaced && memcmp("a=rtcp", line, 6) != 0) {
1658
+	if(!hasreplaced && linelen>=6 && memcmp("a=rtcp", line, 6)!=0) {
1659 1659
 		LM_ERR("can't extract '%s' IP from the SDP\n", line);
1660 1660
 		return -1;
1661 1661
 	}