Browse code

nathelper: check length on new condition inside replace_sdp_ip()

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