Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
fc0f544b25
1 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  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);