summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2020-11-18 15:38:53 (GMT)
committerGitHub <noreply@github.com>2020-11-18 15:38:53 (GMT)
commit07f2adedf0940b06d136208ec386d69b7d2d5b43 (patch)
treed0b64e336c25ed40ca94e70f3363a31b633136a6 /Parser
parent46f59ebd01e22cc6a56fd0691217318c1d801a49 (diff)
downloadcpython-07f2adedf0940b06d136208ec386d69b7d2d5b43.zip
cpython-07f2adedf0940b06d136208ec386d69b7d2d5b43.tar.gz
cpython-07f2adedf0940b06d136208ec386d69b7d2d5b43.tar.bz2
bpo-40998: Address compiler warnings found by ubsan (GH-20929)
Signed-off-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: GH:tiran
Diffstat (limited to 'Parser')
-rw-r--r--Parser/string_parser.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Parser/string_parser.c b/Parser/string_parser.c
index 1285968..8f6433d 100644
--- a/Parser/string_parser.c
+++ b/Parser/string_parser.c
@@ -69,6 +69,9 @@ decode_unicode_with_escapes(Parser *parser, const char *s, size_t len, Token *t)
return NULL;
}
p = buf = PyBytes_AsString(u);
+ if (p == NULL) {
+ return NULL;
+ }
end = s + len;
while (s < end) {
if (*s == '\\') {