Przeglądaj źródła

tmx: be sure From header is parsed before accessing the tag

- reported by Juha Heinanen
Daniel-Constantin Mierla 11 lat temu
rodzic
commit
92ff234d8b
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      modules/tmx/tmx_pretran.c

+ 4 - 0
modules/tmx/tmx_pretran.c

@@ -213,6 +213,10 @@ int tmx_check_pretran(sip_msg_t *msg)
 		LM_ERR("failed to get Via header\n");
 		return -1;
 	}
+	if (parse_from_header(msg)<0 || get_from(msg)->tag_value.len==0) {
+		LM_ERR("failed to get From header\n");
+		return -1;
+	}
 
 	vbr = msg->via1->branch;