From 8788ce35046fa1369809ea75efa5e0d7692b06b5 Mon Sep 17 00:00:00 2001 From: Brian Taylor Date: Tue, 13 Feb 2024 21:21:39 -0800 Subject: [PATCH] Add check for a trailing } in a logicexp statement. --- src/frontend/logicexp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/frontend/logicexp.c b/src/frontend/logicexp.c index ba8d6afc5..36550e1fc 100644 --- a/src/frontend/logicexp.c +++ b/src/frontend/logicexp.c @@ -1075,6 +1075,12 @@ static BOOL bstmt_postfix(void) rest = parse_lexer->lexer_line + parse_lexer->lexer_pos; right_bracket = strstr(rest, "}"); + if (!right_bracket) { + printf("ERROR in bstmt_postfix \'}\' was not found\n"); + aerror("bstmt_postfix: syntax error"); + retval = FALSE; + goto bail_out; + } ds_clear(&infix); ds_cat_mem(&infix, rest, right_bracket - rest); if (infix_to_postfix(ds_get_buf(&infix), &postfix)) {