diff options
Diffstat (limited to 'contrib/tools/python3/src/Parser/string_parser.c')
| -rw-r--r-- | contrib/tools/python3/src/Parser/string_parser.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/tools/python3/src/Parser/string_parser.c b/contrib/tools/python3/src/Parser/string_parser.c index dac8dbb8464..80f158b5a65 100644 --- a/contrib/tools/python3/src/Parser/string_parser.c +++ b/contrib/tools/python3/src/Parser/string_parser.c @@ -740,7 +740,9 @@ fstring_find_expr(Parser *p, const char **str, const char *end, int raw, int rec while (Py_ISSPACE(**str)) { *str += 1; } - + if (*str >= end) { + goto unexpected_end_of_string; + } /* Set *expr_text to the text of the expression. */ *expr_text = PyUnicode_FromStringAndSize(expr_start, *str-expr_start); if (!*expr_text) { |
