summaryrefslogtreecommitdiffstats
path: root/Parser/string_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'Parser/string_parser.c')
-rw-r--r--Parser/string_parser.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Parser/string_parser.c b/Parser/string_parser.c
index 9c12d8c..5e94d47 100644
--- a/Parser/string_parser.c
+++ b/Parser/string_parser.c
@@ -756,7 +756,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) {