瀏覽代碼

dialog(k): give dir parameter to get_dlg()

- initialized to DLG_DIR_NONE to fix accessing NULL pointer for
  searching dialog by msg attributes
- patch by Jasmin Schnatterbeck
Daniel-Constantin Mierla 13 年之前
父節點
當前提交
fc0f544b25
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      modules_k/dialog/dlg_handlers.c

+ 5 - 3
modules_k/dialog/dlg_handlers.c

@@ -975,8 +975,9 @@ dlg_cell_t *dlg_get_msg_dialog(sip_msg_t *msg)
 {
 	dlg_cell_t *dlg = NULL;
 	str callid;
-    str ftag;
-    str ttag;
+	str ftag;
+	str ttag;
+	unsigned int dir;
 
 	/* Retrieve the current dialog */
 	dlg = dlg_get_ctx_dialog();
@@ -985,7 +986,8 @@ dlg_cell_t *dlg_get_msg_dialog(sip_msg_t *msg)
 	
 	if (pre_match_parse(msg, &callid, &ftag, &ttag, 0)<0)
 		return NULL;
-	dlg = get_dlg(&callid, &ftag, &ttag, NULL);
+	dir = DLG_DIR_NONE;
+	dlg = get_dlg(&callid, &ftag, &ttag, &dir);
 	if (dlg==NULL){
 		LM_DBG("dlg with callid '%.*s' not found\n",
 				msg->callid->body.len, msg->callid->body.s);