浏览代码

core: parser sdp - check len gor extracting fmtp

Daniel-Constantin Mierla 11 月之前
父节点
当前提交
d10257fbfd
共有 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;
 	}