cpython/Objects
Miss Islington (bot) d2aaf818ae
[3.11] gh-101037: Fix potential memory underallocation for zeros of int subtypes (GH-101038) (#101219)
gh-101037: Fix potential memory underallocation for zeros of int subtypes (GH-101038)

This PR fixes object allocation in long_subtype_new to ensure that there's at least one digit in all cases, and makes sure that the value of that digit is copied over from the source long.

Needs backport to 3.11, but not any further: the change to require at least one digit was only introduced for Python 3.11.

Fixes GH-101037.
(cherry picked from commit 401fdf9c85)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2023-01-21 10:54:09 +00:00
..
clinic gh-91320: Argument Clinic uses _PyCFunction_CAST() (#32210) 2022-05-03 20:25:41 +02:00
stringlib gh-84461: Silence some compiler warnings on WASM (GH-93978) 2022-06-20 05:08:14 -07:00
abstract.c Use static inline function Py_EnterRecursiveCall() (#91988) 2022-05-04 13:30:23 +02:00
accu.c bpo-35081: Move accu.h to Include/internal/pycore_accu.h (GH-10271) 2018-11-01 02:30:36 +01:00
boolobject.c GH-90699: fix ref counting of static immortal strings (gh-94850) 2022-07-19 23:56:47 -07:00
bytearrayobject.c GH-91153: Handle mutating __index__ methods in bytearray item assignment (GH-94891) 2022-07-19 10:12:39 -07:00
bytes_methods.c bpo-43179: Generalise alignment for optimised string routines (GH-24624) 2021-03-31 12:12:39 +02:00
bytesobject.c gh-101056: Fix memory leak in formatfloat() in bytesobject.c (GH-101057) 2023-01-16 03:12:23 -08:00
call.c Use static inline function Py_EnterRecursiveCall() (#91988) 2022-05-04 13:30:23 +02:00
capsule.c bpo-45855: document that no_block has no use anymore in PyCapsule_Import (#29665) 2021-12-12 10:49:50 +01:00
cellobject.c bpo-40268: Remove unused pycore_pymem.h includes (GH-19531) 2020-04-15 02:57:50 +02:00
classobject.c bpo-46764: Fix wrapping bound method with @classmethod (#31367) 2022-05-04 23:00:21 -05:00
codeobject.c [3.11] GH-97779: Ensure that *all* frame objects are backed by "complete" frames (GH-97886) 2022-10-04 22:46:34 -07:00
complexobject.c bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized global objects. (gh-30928) 2022-02-08 13:39:07 -07:00
descrobject.c [3.11] GH-100942: Fix incorrect cast in property_copy(). (GH-100965). (#101008) 2023-01-15 12:38:25 +05:30
dictnotes.txt bpo-46845: Reduce dict size when all keys are Unicode (GH-31564) 2022-03-02 08:09:28 +09:00
dictobject.c [3.11] gh-99886: Fix crash when freeing objects with managed dictionaries (#99902) 2022-12-04 14:41:23 +08:00
enumobject.c bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized global objects. (gh-30928) 2022-02-08 13:39:07 -07:00
exception_handling_notes.txt gh-96455: update example in exception_handling_notes.txt to the 3.11RC bytecode (GH-96456) 2022-09-01 06:45:09 -07:00
exceptions.c gh-99553: fix bug where an ExceptionGroup subclass can wrap a BaseException (GH-99572) 2022-11-18 08:10:55 -08:00
fileobject.c bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized global objects. (gh-30928) 2022-02-08 13:39:07 -07:00
floatobject.c gh-95605: Fix float(s) error message when s contains only whitespace (GH-95665) (GH-95858) 2022-08-11 17:16:53 +01:00
frame_layout.md GH-89480: Document motivation, design and implementation of 3.11 frame stack. (GH-32304) 2022-04-11 16:05:20 +01:00
frameobject.c [3.11] gh-99110: Initialize frame->previous in init_frame to fix segmentation fault (GH-100182) (#100478) 2022-12-24 11:17:10 +05:30
funcobject.c gh-97943: PyFunction_GetAnnotations should return a borrowed reference. (GH-97949) 2022-10-06 13:03:32 -07:00
genericaliasobject.c gh-98852: Fix subscription of type aliases (GH-98920) 2022-11-01 01:01:28 -07:00
genobject.c Add more stats for freelist use and allocations. (GH-92211) 2022-05-03 16:40:24 -06:00
interpreteridobject.c bpo-35081: Move interpreteridobject.h to Include/internal/ (GH-28969) 2021-10-15 11:56:34 +02:00
iterobject.c bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized global objects. (gh-30928) 2022-02-08 13:39:07 -07:00
listobject.c gh-97616: list_resize() checks for integer overflow (GH-97617) 2022-09-28 15:28:38 -07:00
listsort.txt Fix typos in the Objects directory (GH-28766) 2021-10-06 16:57:10 -07:00
lnotab_notes.txt bpo-44525: Split calls into PRECALL and CALL (GH-30011) 2021-12-14 18:22:44 +00:00
locations.md GH-88116: Use a compact format to represent end line and column offsets. (GH-91666) 2022-04-21 16:10:37 +01:00
longobject.c [3.11] gh-101037: Fix potential memory underallocation for zeros of int subtypes (GH-101038) (#101219) 2023-01-21 10:54:09 +00:00
memoryobject.c gh-92888: Fix memoryview bad __index__ use after free (GH-92946) 2022-06-18 07:40:39 -07:00
methodobject.c Use static inline function Py_EnterRecursiveCall() (#91988) 2022-05-04 13:30:23 +02:00
moduleobject.c no-issue: Add assertion to PyModule_GetName for understanding (GH-32236) 2022-04-02 09:56:30 +09:00
namespaceobject.c bpo-45482: Rename namespaceobject.h to pycore_namespace.h (GH-28975) 2021-10-15 15:21:21 +02:00
object.c gh-99845: _PyObject_DictPointer(): fix dictoffset cast (#99922) 2022-12-01 14:07:58 +01:00
obmalloc.c obmalloc: Remove unused variable. (GH-98770) 2022-10-27 09:30:46 -07:00
odictobject.c gh-91320: Use _PyCFunction_CAST() (#92251) 2022-05-03 21:42:14 +02:00
picklebufobject.c gh-91118: Fix docstrings that do not honor --without-doc-strings (#31769) 2022-04-17 20:39:32 -07:00
rangeobject.c bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized global objects. (gh-30928) 2022-02-08 13:39:07 -07:00
README Issue #18093: Factor out the programs that embed the runtime 2014-07-25 21:52:14 +10:00
setobject.c bpo-26579: Add object.__getstate__(). (GH-2821) 2022-04-06 20:00:14 +03:00
sliceobject.c gh-91731: Replace Py_BUILD_ASSERT() with static_assert() (#91730) 2022-04-20 19:26:40 +02:00
structseq.c bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized global objects. (gh-30928) 2022-02-08 13:39:07 -07:00
tupleobject.c Add more stats for freelist use and allocations. (GH-92211) 2022-05-03 16:40:24 -06:00
typeobject.c gh-96046: Initialize ht_cached_keys in PyType_Ready() (GH-96047) 2022-08-22 02:12:42 -07:00
typeslots.inc bpo-41073: PyType_GetSlot() can now accept static types. (GH-21931) 2020-11-10 12:53:46 -08:00
typeslots.py bpo-41073: PyType_GetSlot() can now accept static types. (GH-21931) 2020-11-10 12:53:46 -08:00
unicodectype.c bpo-46670: Remove unused macros in the Objects directory (GH-31193) 2022-02-07 16:21:41 +01:00
unicodeobject.c [3.11] gh-98783: Fix crashes when str subclasses are used in _PyUnicode_Equal (GH-98806) (#98871) 2022-10-30 14:30:08 -04:00
unicodetype_db.h closes bpo-45190: Update Unicode data to version 14.0.0. (GH-28336) 2021-09-14 11:00:38 -07:00
unionobject.c gh-91603: Speed up isinstance/issubclass on union types (GH-91631) 2022-04-28 23:24:19 +08:00
weakrefobject.c [3.11] gh-95324: Emit a warning if an object doesn't call PyObject_GC_UnTrack during deallocation in debug mode (GH-95325) (#95336) 2022-07-27 16:55:44 +01:00

Source files for various builtin objects