Message325448
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? |
|
Date |
User |
Action |
Args |
2018-09-15 17:13:13 | izbyshev | set | recipients:
+ izbyshev, amaury.forgeotdarc, belopolsky, meador.inge, berker.peksag, serhiy.storchaka |
2018-09-15 17:13:13 | izbyshev | set | messageid: <1537031593.26.0.956365154283.issue34697@psf.upfronthosting.co.za> |
2018-09-15 17:13:13 | izbyshev | link | issue34697 messages |
2018-09-15 17:13:13 | izbyshev | create | |
|