|
@@ -1942,14 +1942,24 @@ static void pp_ifdef()
|
|
|
|
|
|
static void pp_else()
|
|
|
{
|
|
|
+ if(pp_sptr==0) {
|
|
|
+ LM_WARN("invalid position for preprocessor directive 'else'"
|
|
|
+ " - at %s line %d\n", (finame)?finame:"cfg", line);
|
|
|
+ return;
|
|
|
+ }
|
|
|
pp_ifdef_stack[pp_sptr-1] ^= 1;
|
|
|
pp_update_state();
|
|
|
}
|
|
|
|
|
|
static void pp_endif()
|
|
|
{
|
|
|
- pp_sptr--;
|
|
|
pp_ifdef_level_update(-1);
|
|
|
+ if(pp_sptr==0) {
|
|
|
+ LM_WARN("invalid position for preprocessor directive 'else'"
|
|
|
+ " - at %s line %d\n", (finame)?finame:"cfg", line);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ pp_sptr--;
|
|
|
pp_update_state();
|
|
|
}
|
|
|
|