cpython/Objects
Miss Islington (bot) 392520bd78 bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537) (GH-6543)
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 397f1b28c4)
2018-04-20 10:06:21 -07:00
..
clinic bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342) 2018-01-27 14:06:21 +09:00
stringlib bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342) 2018-01-27 14:06:21 +09:00
README Issue #18093: Factor out the programs that embed the runtime 2014-07-25 21:52:14 +10:00
abstract.c bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code (GH-5222) 2018-01-25 17:49:40 +09:00
accu.c Replace KB unit with KiB (#4293) 2017-11-08 14:44:44 -08:00
boolobject.c bpo-30592: Fixed error messages for some builtins. (#1996) 2017-06-08 14:41:19 +03:00
bytearrayobject.c bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342) 2018-01-27 14:06:21 +09:00
bytes_methods.c bpo-32677: Optimize str.isascii() (GH-5356) 2018-01-28 09:59:12 +09:00
bytesobject.c bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342) 2018-01-27 14:06:21 +09:00
call.c bpo-32240: Add the const qualifier to declarations of PyObject* array arguments. (#4746) 2017-12-15 13:11:11 +02:00
capsule.c Issue #2443: Added a new macro, Py_VA_COPY, which is equivalent to C99 2010-08-11 17:31:17 +00:00
cellobject.c bpo-23699: Use a macro to reduce boilerplate code in rich comparison functions (GH-793) 2017-11-02 20:32:54 +10:00
classobject.c bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code (GH-5222) 2018-01-25 17:49:40 +09:00
codeobject.c bpo-32176: Set CO_NOFREE in the code object constructor (GH-4675) 2017-12-03 11:12:20 +10:00
complexobject.c bpo-31979: Simplify transforming decimals to ASCII (#4336) 2017-11-13 21:23:48 +02:00
descrobject.c bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995) 2018-02-13 03:32:18 -08:00
dict-common.h bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537) (GH-6543) 2018-04-20 10:06:21 -07:00
dictnotes.txt Issue #15055: update dictnotes.txt. Patch by Mark Shannon. 2012-06-24 21:03:45 +02:00
dictobject.c bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537) (GH-6543) 2018-04-20 10:06:21 -07:00
enumobject.c bpo-31579: Fixed a possible leak in enumerate() with large indices. (#3753) 2017-09-26 08:14:58 +03:00
exceptions.c bpo-32685: Improve suggestion for print statement (GH-5375) 2018-01-28 20:56:02 +10:00
fileobject.c bpo-29548: Fix some inefficient call API usage (GH-97) 2017-02-16 09:26:01 +09:00
floatobject.c Fix typo and edit for clarity in the docstrings of sys.float_info. (GH-2251) 2018-03-26 03:58:10 -07:00
frameobject.c [3.7] bpo-17288: Prevent jumps from 'return' and 'exception' trace events. (GH-5928) 2018-03-13 10:52:35 +02:00
funcobject.c bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995) 2018-02-13 03:32:18 -08:00
genobject.c bpo-32703: Fix coroutine resource warning in case where there's an error (GH-5410) 2018-01-29 14:31:47 -05:00
iterobject.c bpo-30860: Consolidate stateful runtime globals. (#3397) 2017-09-07 23:51:28 -06:00
listobject.c closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800) 2018-02-21 21:44:08 -08:00
listsort.txt bpo-28685: Optimize sorted() list.sort() with type-specialized comparisons (#582) 2018-01-28 19:03:23 -08:00
lnotab_notes.txt bpo-28810: Update lnotab_notes.txt (#665) 2017-03-14 21:42:09 +02:00
longobject.c PyLong_FromString(): fix Coverity CID 1424951 (#4738) 2017-12-08 00:06:55 +01:00
memoryobject.c bpo-30860: Consolidate stateful runtime globals. (#3397) 2017-09-07 23:51:28 -06:00
methodobject.c bpo-30860: Consolidate stateful runtime globals. (#3397) 2017-09-07 23:51:28 -06:00
moduleobject.c bpo-32374: m_traverse may be called with m_state=NULL (GH-5140) 2018-03-16 23:03:56 -07:00
namespaceobject.c bpo-31655: Validate keyword names in SimpleNamespace constructor. (#3909) 2017-10-07 22:59:35 +03:00
object.c closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800) 2018-02-21 21:44:08 -08:00
obmalloc.c [3.7] bpo-32746: Fix multiple typos (GH-5144) (GH-5520) 2018-02-03 20:41:43 -05:00
odictobject.c [3.7] bpo-33031: Remove dead code in C implementation of OrderedDict. (GH-6120) (GH-6433) 2018-04-09 21:46:41 +03:00
rangeobject.c bpo-30592: Fixed error messages for some builtins. (#1996) 2017-06-08 14:41:19 +03:00
setobject.c Removed unnecesssary bit inversion which doesn't improve dispersion statistics (#5235) 2018-01-18 13:23:27 -08:00
sliceobject.c bpo-30860: Consolidate stateful runtime globals. (#3397) 2017-09-07 23:51:28 -06:00
structseq.c bpo-29793: Convert some builtin types constructors to Argument Clinic. (#615) 2017-03-19 08:51:07 +02:00
tupleobject.c closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800) 2018-02-21 21:44:08 -08:00
typeobject.c [3.7] bpo-32746: Fix multiple typos (GH-5144) (GH-5520) 2018-02-03 20:41:43 -05:00
typeslots.inc add Py_tp_finalize slot (closes #24345) 2015-06-01 10:12:48 -05:00
typeslots.py Issue #26662: Set PYTHON_FOR_GEN in configure 2016-07-26 12:48:08 +02:00
unicodectype.c Removed unintentional trailing spaces in non-external and non-generated C files. 2015-03-18 21:53:15 +02:00
unicodeobject.c bpo-32827: Fix usage of _PyUnicodeWriter_Prepare() in decoding errors handler. (GH-5636) (GH-5650) 2018-02-13 09:15:57 +02:00
unicodetype_db.h bpo-30736: upgrade to Unicode 10.0 (#2344) 2017-06-22 22:31:08 -07:00
weakrefobject.c bpo-30592: Fixed error messages for some builtins. (#1996) 2017-06-08 14:41:19 +03:00

README

Source files for various builtin objects