Module: kamailio Branch: master Commit: af9deb9026a271aa3a1bdbb5685b63e3e78772bd URL: https://github.com/kamailio/kamailio/commit/af9deb9026a271aa3a1bdbb5685b63e3...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2015-05-14T13:33:50+02:00
core: safety checks for swich statements with no case branch
---
Modified: switch.c
---
Diff: https://github.com/kamailio/kamailio/commit/af9deb9026a271aa3a1bdbb5685b63e3... Patch: https://github.com/kamailio/kamailio/commit/af9deb9026a271aa3a1bdbb5685b63e3...
---
diff --git a/switch.c b/switch.c index b4a6b75..6aeffc2 100644 --- a/switch.c +++ b/switch.c @@ -230,7 +230,9 @@ int fix_switch(struct action* t) LM_DBG("default only switch optimized away (BLOCK_T)\n"); return 0; } - LM_DBG("default only switch with side-effect...\n"); + LM_CRIT("default only switch with side-effect not expected at this point\n"); + ret=E_BUG; + goto error; }else{ LM_CRIT("empty switch not expected at this point\n"); ret=E_BUG; @@ -545,7 +547,9 @@ static int fix_match(struct action* t) LM_DBG("default only switch optimized away (BLOCK_T)\n"); return 0; } - LM_DBG("default only switch with side-effect...\n"); + LM_CRIT("default only switch with side-effect not expected at this point\n"); + ret=E_BUG; + goto error; }else{ LM_CRIT("empty switch not expected at this point\n"); ret=E_BUG;