gh-94930: skipitem() in getargs.c should return non-NULL on error (GH-94931)

(cherry picked from commit 067f0da335)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-07-18 08:41:22 -07:00 committed by GitHub
parent a914fa979e
commit ec6ed6681d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 8 deletions

View file

@ -2695,9 +2695,7 @@ skipitem(const char **p_format, va_list *p_va, int flags)
if (*format == '#') {
if (p_va != NULL) {
if (!(flags & FLAG_SIZE_T)) {
PyErr_SetString(PyExc_SystemError,
"PY_SSIZE_T_CLEAN macro must be defined for '#' formats");
return NULL;
return "PY_SSIZE_T_CLEAN macro must be defined for '#' formats";
}
(void) va_arg(*p_va, Py_ssize_t *);
}