pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/769aea332940f03c3e5b1ad9badd6635c1ac992a

5097560d244c08.css" /> gh-120155: Fix Coverity issue in parse_string() (#120997) · python/cpython@769aea3 · GitHub
Skip to content

Commit 769aea3

Browse files
authored
gh-120155: Fix Coverity issue in parse_string() (#120997)
1 parent 2d3187b commit 769aea3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Parser/string_parser.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,14 @@ _PyPegen_parse_string(Parser *p, Token *t)
229229
PyErr_BadInternalCall();
230230
return NULL;
231231
}
232+
232233
/* Skip the leading quote char. */
233234
s++;
234235
len = strlen(s);
236+
// gh-120155: 's' contains at least the trailing quote,
237+
// so the code '--len' below is safe.
238+
assert(len >= 1);
239+
235240
if (len > INT_MAX) {
236241
PyErr_SetString(PyExc_OverflowError, "string to parse is too long");
237242
return NULL;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy