diff options
| author | Joe Jevnik <JoeJev@gmail.com> | 2024-04-23 11:15:15 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-23 11:15:15 (GMT) |
| commit | eb927e9fc823de9539fcb82c9ea9d055462eb04a (patch) | |
| tree | c51abe6fd065cbdbbfa1e95f2bbf2f90a6d85eef /Python/getargs.c | |
| parent | e17cd1fbfd4f20824c686c7242423e84ba6a6cc5 (diff) | |
| download | cpython-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/getargs.c')
| -rw-r--r-- | Python/getargs.c | 5 |
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 *); |
