This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author izbyshev
Recipients amaury.forgeotdarc, belopolsky, berker.peksag, izbyshev, meador.inge, serhiy.storchaka
Date 2018-09-15.17:13:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
It is possible to manually create an instance of private CField type which is used by ctypes to represent fields of Structure and Union types. This instance will be uninitialized because it's normally initialized when instances of Structure/Union are created, so calling its methods may crash the interpreter:

from ctypes import *

class S(Structure):
    _fields_ = [('x', c_int)]

CField = type(S.x)
f = CField()
repr(f) # Crash here

Is this issue worth fixing?

If so, is the correct way to set tp_new slot to NULL and fix the internal callers so that users wouldn't be able to create CField instances?
History
Date User Action Args
2018-09-15 17:13:13izbyshevsetrecipients: + izbyshev, amaury.forgeotdarc, belopolsky, meador.inge, berker.peksag, serhiy.storchaka
2018-09-15 17:13:13izbyshevsetmessageid: <[email protected]>
2018-09-15 17:13:13izbyshevlinkissue34697 messages
2018-09-15 17:13:13izbyshevcreate