Skip to content

Commit

Permalink
core: more safety checks for getting int values from cfg function params
Browse files Browse the repository at this point in the history
- related to GH #1011

(cherry picked from commit 97b3ce7)
  • Loading branch information
miconda committed Mar 13, 2017
1 parent 8c38fad commit fb859b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/sr_module.c
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fb859b9

Please sign in to comment.