Skip to content

getargs.c: incorrect handling of errors in skipitem() #94930

Closed
@serhiy-storchaka

Description

@serhiy-storchaka

There is yet one bug in handling errors in getargs.c.

skipitem() returns NULL on success and non-NULL string containing an error message on error. Except one case: when the # suffix is used while PY_SSIZE_T_CLEAN is not defined. In this case an error is set and skipitem() returns NULL, but all callers of skipitem() do not expect it.

Currently this bug is only causes a hang if an optional parameter is a tuple containing a nested type with the "#" suffix, e.g. "...|(s#)...".

3.9 is most likely also affected, but only if you turn DeprecationWarning into exception (run Python with option -Werror). I am wondering whether it can be considered a security issue. @ambv

Similar issues were #87487 and #94902.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10only security fixes3.11only security fixes3.12only security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions