summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-11-18 16:01:48 (GMT)
committerGitHub <noreply@github.com>2020-11-18 16:01:48 (GMT)
commit994c68f586441cee755508e9357e6e03e2b7a887 (patch)
tree28312823d8d46acaa8f72a7c1e7dc7f3728f8f41 /Parser
parent802ff7c0d339376a1b974e57d2caca898310de3d (diff)
downloadcpython-994c68f586441cee755508e9357e6e03e2b7a887.zip
cpython-994c68f586441cee755508e9357e6e03e2b7a887.tar.gz
cpython-994c68f586441cee755508e9357e6e03e2b7a887.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 (cherry picked from commit 07f2adedf0940b06d136208ec386d69b7d2d5b43) Co-authored-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Parser')
-rw-r--r--Parser/pegen/parse_string.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Parser/pegen/parse_string.c b/Parser/pegen/parse_string.c
index 7b02bdd..fb0c4af 100644
--- a/Parser/pegen/parse_string.c
+++ b/Parser/pegen/parse_string.c
@@ -74,6 +74,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 == '\\') {