summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Parser/string_parser.c
diff options
context:
space:
mode:
authorarcadia-devtools <[email protected]>2022-06-09 19:02:01 +0300
committerarcadia-devtools <[email protected]>2022-06-09 19:02:01 +0300
commit4a29d649866ff133e0b8f8a1009e1000a44d7279 (patch)
tree547229aded91b3760628c646a144af604f1c3e2b /contrib/tools/python3/src/Parser/string_parser.c
parent782f2445a283aed9a66e699137b3349af1689c29 (diff)
intermediate changes
ref:478170c7a5a1c0788ddd0d6513ce4ed86d7d7c99
Diffstat (limited to 'contrib/tools/python3/src/Parser/string_parser.c')
-rw-r--r--contrib/tools/python3/src/Parser/string_parser.c4
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) {