Module: kamailio Branch: master Commit: 97b3ce7c8991774f42c013122704f32e2822ac58 URL: https://github.com/kamailio/kamailio/commit/97b3ce7c8991774f42c013122704f32e...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2017-03-13T18:13:05+01:00
core: more safety checks for getting int values from cfg function params
- related to GH #1011
---
Modified: src/core/sr_module.c
---
Diff: https://github.com/kamailio/kamailio/commit/97b3ce7c8991774f42c013122704f32e... Patch: https://github.com/kamailio/kamailio/commit/97b3ce7c8991774f42c013122704f32e...
---
diff --git a/src/core/sr_module.c b/src/core/sr_module.c index 1ab32a5..2bf336c 100644 --- a/src/core/sr_module.c +++ b/src/core/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;