Jelajahi Sumber

dialog(k): safety check for callid parameter in mi commands

- if not provided properly, it may result in crash
- reported by Ricardo Martinez
Daniel-Constantin Mierla 12 tahun lalu
induk
melakukan
8acb59ee4d
1 mengubah file dengan 2 tambahan dan 0 penghapusan
  1. 2 0
      modules_k/dialog/dlg_hash.c

+ 2 - 0
modules_k/dialog/dlg_hash.c

@@ -1174,6 +1174,8 @@ static inline struct mi_root* process_mi_params(struct mi_root *cmd_tree,
 
 	/* we have params -> get callid and fromtag */
 	callid = &node->value;
+	if(callid->s==NULL || callid->len<=0)
+		return init_mi_tree(400, MI_SSTR(MI_MISSING_PARM));
 	LM_DBG("callid='%.*s'\n", callid->len, callid->s);
 
 	node = node->next;