You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Building a ctypes.CField with wrong byte_size aborts #132470
Field wasn't meant to be used publicly for now but, since it's a real crash and if we're to expose this interface in the future, we would be happy to have this check.
To set expectations: the CField initializer is indeed not public. If you use _internal_use=True, you are on your own -- don't blame CPython if it crashes.
With that said, thank you for testing this internal API! And thank you for the fix -- when CField becomes public, there'll be one less thing to do.
Activity
picnixz commentedon Apr 13, 2025
Fieldwasn't meant to be used publicly for now but, since it's a real crash and if we're to expose this interface in the future, we would be happy to have this check.Fix: Prevent crash in ctypes.CField when byte_size does not match typ…
Add regression test for invalid byte_size in ctypes.CField
Add regression test for invalid byte_size in ctypes.CField
Add regression test for invalid byte_size in ctypes.CField
gh-132470: Prevent crash in ctypes.CField when `byte_size` is incorre…
encukou commentedon Apr 28, 2025
To set expectations: the
CFieldinitializer is indeed not public. If you use_internal_use=True, you are on your own -- don't blame CPython if it crashes.With that said, thank you for testing this internal API! And thank you for the fix -- when
CFieldbecomes public, there'll be one less thing to do.