Ver código fonte

peering: check return code when parsing all headers

(cherry picked from commit 9e0fbfd9a79764fb283b6a6864e6519e167fff82)
Daniel-Constantin Mierla 7 anos atrás
pai
commit
ef849f0dcb
1 arquivos alterados com 4 adições e 1 exclusões
  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)