Răsfoiți Sursa

core: parser sdp - check length for rtpmap extract

(cherry picked from commit c823f41350ab9186a323707e9be32e31922bec17)
(cherry picked from commit 0408c2cb412f0df0a17b70aa4d15026a9ef3a9a7)
Daniel-Constantin Mierla 11 luni în urmă
părinte
comite
3a5db8000d
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      src/core/parser/sdp/sdp_helpr_funcs.c

+ 3 - 0
src/core/parser/sdp/sdp_helpr_funcs.c

@@ -151,6 +151,9 @@ int extract_rtpmap(str *body, str *rtpmap_payload, str *rtpmap_encoding,
 	char *cp, *cp1;
 	int len;
 
+	if(body->len <= 9) {
+		return -1;
+	}
 	if(strncasecmp(body->s, "a=rtpmap:", 9) != 0) {
 		/*LM_DBG("We are not pointing to an a=rtpmap: attribute =>`%.*s'\n",
 		 * body->len, body->s); */