2
0
Эх сурвалжийг харах

- fixed bad to check (crash for messages w/o to header)

Andrei Pelinescu-Onciul 19 жил өмнө
parent
commit
5da204aec6
1 өөрчлөгдсөн 4 нэмэгдсэн , 2 устгасан
  1. 4 2
      id.c

+ 4 - 2
id.c

@@ -155,8 +155,10 @@ int get_to_uid(str* uid, struct sip_msg* msg)
 		*uid = val.s;
 		return 1;
 	} else {
-		if (parse_headers(msg, HDR_TO_F, 0) < 0) {
-			LOG(L_ERR, "get_to_uid: Error while parsing To URI (parse_headers)\n");
+		if ((msg->to==0) && 
+				(parse_headers(msg, HDR_TO_F, 0)<0 || msg->to==0)) {
+			LOG(L_ERR, "get_to_uid: Error while parsing To URI: "
+					" to header bad or missing\n");
 			return -1;
 		}
 		to = get_to(msg);