summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/wps_parser.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index 86bd096e8c..84e1b185dc 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -961,6 +961,11 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr)
961 data->tokens[data->num_tokens].type = WPS_TOKEN_CONDITIONAL_END; 961 data->tokens[data->num_tokens].type = WPS_TOKEN_CONDITIONAL_END;
962 if (lastcond[level]) 962 if (lastcond[level])
963 data->tokens[lastcond[level]].value.i = data->num_tokens; 963 data->tokens[lastcond[level]].value.i = data->num_tokens;
964 else
965 {
966 fail = PARSE_FAIL_COND_SYNTAX_ERROR;
967 break;
968 }
964 969
965 lastcond[level] = 0; 970 lastcond[level] = 0;
966 data->num_tokens++; 971 data->num_tokens++;
@@ -979,6 +984,11 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr)
979 data->tokens[data->num_tokens].type = WPS_TOKEN_CONDITIONAL_OPTION; 984 data->tokens[data->num_tokens].type = WPS_TOKEN_CONDITIONAL_OPTION;
980 if (lastcond[level]) 985 if (lastcond[level])
981 data->tokens[lastcond[level]].value.i = data->num_tokens; 986 data->tokens[lastcond[level]].value.i = data->num_tokens;
987 else
988 {
989 fail = PARSE_FAIL_COND_SYNTAX_ERROR;
990 break;
991 }
982 992
983 lastcond[level] = data->num_tokens; 993 lastcond[level] = data->num_tokens;
984 numoptions[level]++; 994 numoptions[level]++;
@@ -1085,7 +1095,7 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr)
1085 } 1095 }
1086 } 1096 }
1087 1097
1088 if (level >= 0) /* there are unclosed conditionals */ 1098 if (!fail && level >= 0) /* there are unclosed conditionals */
1089 fail = PARSE_FAIL_UNCLOSED_COND; 1099 fail = PARSE_FAIL_UNCLOSED_COND;
1090 1100
1091#ifdef DEBUG 1101#ifdef DEBUG