Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test_unicode test_raiseMemError miscalculates struct size when string has UTF-8 representation. #93575

Closed
Labels
3.11only security fixes3.12only security fixestestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error
@tiran

Description

@tiran

The test casetest_raiseMemError assumes that all structs have a NULL byte of length 1. Howevercompact_struct_size allocate 2 or 4 bytes space for NULL bytes:(PyUnicode_GET_LENGTH(self) + 1) * PyUnicode_KIND(self). Note that it's(len(s) + 1) * char_size, notlen(s) * char_size + 1. The bug introduces an off-by-one / off-by-three error that sometimes leads to failing test on WASI, because code does not raise a memory error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixestestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp