• Miss Islington (bot)'s avatar
    bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537) (GH-6543) · 392520bd
    Miss Islington (bot) yazdı
    Fix clang ubsan (undefined behavior sanitizer) warnings in dictobject.c by
    adjusting how the internal struct _dictkeysobject shared keys structure is
    declared.
    
    This remains ABI compatible.  We get rid of the union at the end of the
    struct being used for conveinence to avoid typecasting in favor of char[]
    variable length array at the end of a struct. This is known to clang to be
    used for variable sized objects and will not cause an undefined behavior
    problem.  Similarly, char arrays do not have strict aliasing undefined
    behavior when cast.
    
    PEP-007 does not currently list variable length arrays (VLAs) as allowed
    in our subset of C99.  If this turns out to be a problem, the fix to this is
    to change the char `dk_indices[]` into `dk_indices[1]` and restore the
    three size computation subtractions this change removes:
      `- Py_MEMBER_SIZE(PyDictKeysObject, dk_indices)`
    
    If this works as is I'll make a separate PR to update PEP-007.
    (cherry picked from commit 397f1b28)
    392520bd
Adı
Son kayıt (commit)
Son güncelleme
..
NEWS.d Loading commit data...
ACKS Loading commit data...
HISTORY Loading commit data...
Porting Loading commit data...
README Loading commit data...
README.AIX Loading commit data...
README.coverity Loading commit data...
README.valgrind Loading commit data...
SpecialBuilds.txt Loading commit data...
coverity_model.c Loading commit data...
gdbinit Loading commit data...
indent.pro Loading commit data...
python-config.in Loading commit data...
python-config.sh.in Loading commit data...
python-wing3.wpr Loading commit data...
python-wing4.wpr Loading commit data...
python-wing5.wpr Loading commit data...
python.man Loading commit data...
python.pc.in Loading commit data...
svnmap.txt Loading commit data...
valgrind-python.supp Loading commit data...
vgrindefs Loading commit data...