Skip to content

PyUnicode_DecodeUTF8Stateful() does not set *consumed for ASCII-only string #99612

Description

@serhiy-storchaka

PyUnicode_DecodeUTF8Stateful() should save the number of successfully decoded bytes in *consumed. But if all bytes are in the ASCII range, it uses a fast path and does not set *consumed.

It was found during writing coverage tests for Unicode C API (#99593).

Linked PRs

Activity

  1. added a commit that references this issue on Nov 20, 2022
  2. added a commit that references this issue on Dec 1, 2022
  3. added a commit that references this issue on Dec 1, 2022
  4. added a commit that references this issue on Jul 25, 2023
  5. 1 remaining item

  6. serhiy-storchaka commented on Jul 25, 2023

    @serhiy-storchaka
    MemberAuthor

    Since this is a bug in the C API, I consider it as a security level fix.

  7. added a commit that references this issue on Jul 25, 2023
  8. added a commit that references this issue on Jul 25, 2023
  9. added a commit that references this issue on Jul 25, 2023
  10. removed
    3.11only security fixes
    3.12only security fixes
    on Jul 26, 2023
  11. added 2 commits that reference this issue on Aug 22, 2023
  12. serhiy-storchaka commented on Aug 23, 2023

    @serhiy-storchaka
    MemberAuthor

    3.8 is not affected. The bug was introduced in 770847a (#81529).

  13. added a commit that references this issue on Oct 11, 2023
  14. added a commit that references this issue on Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions