Undefined behavior NULL + 0
in list_extend_{set,dict,dictitems}
#133073
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-bug
An unexpected behavior, bug, or error
Bug report
Found by @emmatyping.
Bug description:
This affects
list_extend_{set,dict,dictitems}
, e.g.:If a list object is empty,
ob->ob_items
will be NULL. In particular,list_resize
won't allocate and the size will be 0. However:becomes equivalent to
NULL + 0
which is UB. There is no runtime error for now because the loop that follows is not executed.CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
list_extend_*
functions #133074The text was updated successfully, but these errors were encountered: