فهرست منبع

core: parser sdp - check len gor extracting fmtp

(cherry picked from commit d10257fbfdbb3e3e73c0fe60a224585822bdd7b3)
(cherry picked from commit 18dad74a091e693a0bf939dddf144348409e6402)
Daniel-Constantin Mierla 11 ماه پیش
والد
کامیت
ad292d121d
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      src/core/parser/sdp/sdp_helpr_funcs.c

+ 5 - 1
src/core/parser/sdp/sdp_helpr_funcs.c

@@ -218,8 +218,12 @@ int extract_fmtp(str *body, str *fmtp_payload, str *fmtp_string)
 	char *cp, *cp1;
 	int len;
 
+	if(body->len <= 7) {
+		return -1;
+	}
 	if(strncasecmp(body->s, "a=fmtp:", 7) != 0) {
-		/*LM_DBG("We are not pointing to an a=fmtp: attribute =>`%.*s'\n", body->len, body->s); */
+		/*LM_DBG("We are not pointing to an a=fmtp: attribute =>`%.*s'\n",
+		 * body->len, body->s); */
 		return -1;
 	}