Module: kamailio
Branch: master
Commit: 618888cc9497ae5c478c41d7b0efc27731b42b22
URL:
https://github.com/kamailio/kamailio/commit/618888cc9497ae5c478c41d7b0efc27…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-03-13T18:13:51+01:00
dialog: more checks for dlg_set_timeout() params
- related to GH #1011
---
Modified: src/modules/dialog/dialog.c
---
Diff:
https://github.com/kamailio/kamailio/commit/618888cc9497ae5c478c41d7b0efc27…
Patch:
https://github.com/kamailio/kamailio/commit/618888cc9497ae5c478c41d7b0efc27…
---
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index c572deb..add899c 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -1133,8 +1133,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");
@@ -1156,7 +1164,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;