Module: kamailio
Branch: 4.4
Commit: 99c0c6ea153ca4299b22c3639cfd3613d0711f43
URL:
https://github.com/kamailio/kamailio/commit/99c0c6ea153ca4299b22c3639cfd361…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-03-14T20:06:37+01:00
dialog: more checks for dlg_set_timeout() params
- related to GH #1011
(cherry picked from commit 618888cc9497ae5c478c41d7b0efc27731b42b22)
(cherry picked from commit 943a5b2c12426b5b6d3839ae899411f4e1a42414)
---
Modified: modules/dialog/dialog.c
---
Diff:
https://github.com/kamailio/kamailio/commit/99c0c6ea153ca4299b22c3639cfd361…
Patch:
https://github.com/kamailio/kamailio/commit/99c0c6ea153ca4299b22c3639cfd361…
---
diff --git a/modules/dialog/dialog.c b/modules/dialog/dialog.c
index ceaf08a..591a8ec 100644
--- a/modules/dialog/dialog.c
+++ b/modules/dialog/dialog.c
@@ -1142,8 +1142,16 @@ static int w_dlg_set_timeout(struct sip_msg *msg, char *pto, char
*phe, char *ph
LM_ERR("no timeout value\n");
return -1;
}
+ if(to<=0) {
+ LM_ERR("invalid timeout value: %d\n", to);
+ return -1;
+ }
if(phe!=NULL)
{
+ if(phi==NULL) {
+ LM_ERR("invalid number of parameters\n");
+ return -1;
+ }
if(fixup_get_ivalue(msg, (gparam_p)phe, (int*)&he)!=0)
{
LM_ERR("no hash entry value value\n");
@@ -1165,7 +1173,7 @@ static int w_dlg_set_timeout(struct sip_msg *msg, char *pto, char
*phe, char *ph
return -1;
}
- if(update_dlg_timeout(dlg, to) != 0)
+ if(update_dlg_timeout(dlg, to) != 0)
return -1;
return 1;