summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorJoe Jevnik <JoeJev@gmail.com>2024-04-23 11:15:15 (GMT)
committerGitHub <noreply@github.com>2024-04-23 11:15:15 (GMT)
commiteb927e9fc823de9539fcb82c9ea9d055462eb04a (patch)
treec51abe6fd065cbdbbfa1e95f2bbf2f90a6d85eef /Python
parente17cd1fbfd4f20824c686c7242423e84ba6a6cc5 (diff)
downloadcpython-eb927e9fc823de9539fcb82c9ea9d055462eb04a.zip
cpython-eb927e9fc823de9539fcb82c9ea9d055462eb04a.tar.gz
cpython-eb927e9fc823de9539fcb82c9ea9d055462eb04a.tar.bz2
gh-68114: Fix handling for removed PyArg_ParseTuple 'w' formatters (GH-8204)
Co-authored-by: Joe Jevnik <joe@quantopian.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r--Python/getargs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index bec9816..539925e 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -2641,6 +2641,11 @@ skipitem(const char **p_format, va_list *p_va, int flags)
if (p_va != NULL) {
(void) va_arg(*p_va, char **);
}
+ if (c == 'w' && *format != '*')
+ {
+ /* after 'w', only '*' is allowed */
+ goto err;
+ }
if (*format == '#') {
if (p_va != NULL) {
(void) va_arg(*p_va, Py_ssize_t *);