diff options
| author | Christian Heimes <christian@python.org> | 2020-11-18 16:38:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-18 07:38:53 -0800 |
| commit | 07f2adedf0940b06d136208ec386d69b7d2d5b43 (patch) | |
| tree | d0b64e336c25ed40ca94e70f3363a31b633136a6 /Parser/string_parser.c | |
| parent | 46f59ebd01e22cc6a56fd0691217318c1d801a49 (diff) | |
| download | cpython-git-07f2adedf0940b06d136208ec386d69b7d2d5b43.tar.gz | |
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/string_parser.c')
| -rw-r--r-- | Parser/string_parser.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Parser/string_parser.c b/Parser/string_parser.c index 1285968b31..8f6433dbce 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 == '\\') { |
