| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -229,9 +229,14 @@ _PyPegen_parse_string(Parser *p, Token *t) | |||
| 229 | 229 | PyErr_BadInternalCall(); | |
| 230 | 230 | return NULL; | |
| 231 | 231 | } | |
| 232 | + | ||
| 232 | 233 | /* Skip the leading quote char. */ | |
| 233 | 234 | s++; | |
| 234 | 235 | 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 | + | ||
| 235 | 240 | if (len > INT_MAX) { | |
| 236 | 241 | PyErr_SetString(PyExc_OverflowError, "string to parse is too long"); | |
| 237 | 242 | return NULL; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments