Module: kamailio
Branch: 4.4
Commit: ab5802239d850010b2f33a7b0a627232cd15e3b9
URL:
https://github.com/kamailio/kamailio/commit/ab5802239d850010b2f33a7b0a62723…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-03-14T20:06:14+01:00
core: more safety checks for getting int values from cfg function params
- related to GH #1011
(cherry picked from commit 97b3ce7c8991774f42c013122704f32e2822ac58)
(cherry picked from commit fb859b9388ddfa82e7c6cf098940d920fead055b)
---
Modified: sr_module.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ab5802239d850010b2f33a7b0a62723…
Patch:
https://github.com/kamailio/kamailio/commit/ab5802239d850010b2f33a7b0a62723…
---
diff --git a/sr_module.c b/sr_module.c
index 25da9cd..c72c6ff 100644
--- a/sr_module.c
+++ b/sr_module.c
@@ -1723,6 +1723,7 @@ int get_int_fparam(int* dst, struct sip_msg* msg, fparam_t* param)
case FPARAM_UNSPEC:
case FPARAM_STRING:
case FPARAM_STR:
+ LM_ERR("Unsupported param type for int value: %d\n", param->type);
return -1;
case FPARAM_AVP:
avp = search_first_avp(param->v.avp.flags, param->v.avp.name,
@@ -1759,6 +1760,10 @@ int get_int_fparam(int* dst, struct sip_msg* msg, fparam_t* param)
}
break;
case FPARAM_PVE:
+ LM_ERR("Unsupported param type for int value: %d\n", param->type);
+ return -1;
+ default:
+ LM_ERR("Unexpected param type: %d\n", param->type);
return -1;
}
return 0;