Browse code

dialog: parse tm callback reply in early phase to detect broken format

(cherry picked from commit 6b9837c30f9d2a2ca937d7e6d8c1c496fe4d7d30)
(cherry picked from commit c2995f731ab3a94f302af63bdad9c3bf61d4e995)

Daniel-Constantin Mierla authored on 22/03/2019 03:17:23
Showing 1 changed files
... ...
@@ -438,6 +438,13 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param)
438 438
 	if(dlg==0)
439 439
 		return;
440 440
 
441
+	if (rpl != FAKED_REPLY) {
442
+		if(parse_headers(rpl, HDR_EOH_F, 0) < 0) {
443
+			LM_ERR("failed to parse the reply headers\n");
444
+			goto done_early;
445
+		}
446
+	}
447
+
441 448
 	unref = 0;
442 449
 	if (type & (TMCB_RESPONSE_IN|TMCB_ON_FAILURE)) {
443 450
 		/* Set the dialog context so it is available in onreply_route and failure_route*/