Pārlūkot izejas kodu

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

Andrei Pelinescu-Onciul 19 gadi atpakaļ
vecāks
revīzija
5da204aec6
1 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  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;
 		*uid = val.s;
 		return 1;
 		return 1;
 	} else {
 	} 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;
 			return -1;
 		}
 		}
 		to = get_to(msg);
 		to = get_to(msg);