瀏覽代碼

peering: check return code when parsing all headers

Daniel-Constantin Mierla 7 年之前
父節點
當前提交
9e0fbfd9a7
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/modules/peering/verify.c

+ 4 - 1
src/modules/peering/verify.c

@@ -328,7 +328,10 @@ int verify_source(struct sip_msg* _msg, char* s1, char* s2)
     }
 
     /* Add P-Request-Hash header body */
-    parse_headers(_msg, HDR_EOH_F, 0);
+	if(parse_headers(_msg, HDR_EOH_F, 0)<0) {
+		LM_ERR("failed to parse headers\n");
+		return -1;
+	}
     for (hf = _msg->headers; hf; hf = hf->next) {
 		if(cmp_hdrname_strzn(&hf->name, "P-Request-Hash",
 			sizeof("P-Request-Hash") - 1) == 0)