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 <1537031593.26.0.956365154283.issue34697@psf.upfronthosting.co.za>
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: <1537031593.26.0.956365154283.issue34697@psf.upfronthosting.co.za>
2018-09-15 17:13:13izbyshevlinkissue34697 messages
2018-09-15 17:13:13izbyshevcreate