瀏覽代碼

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

Daniel-Constantin Mierla 6 年之前
父節點
當前提交
6b9837c30f
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/modules/dialog/dlg_handlers.c

+ 7 - 0
src/modules/dialog/dlg_handlers.c

@@ -438,6 +438,13 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param)
 	if(dlg==0)
 	if(dlg==0)
 		return;
 		return;
 
 
+	if (rpl != FAKED_REPLY) {
+		if(parse_headers(rpl, HDR_EOH_F, 0) < 0) {
+			LM_ERR("failed to parse the reply headers\n");
+			goto done_early;
+		}
+	}
+
 	unref = 0;
 	unref = 0;
 	if (type & (TMCB_RESPONSE_IN|TMCB_ON_FAILURE)) {
 	if (type & (TMCB_RESPONSE_IN|TMCB_ON_FAILURE)) {
 		/* Set the dialog context so it is available in onreply_route and failure_route*/
 		/* Set the dialog context so it is available in onreply_route and failure_route*/