SIGN IN SIGN UP

[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 401fdf9c851eb61229250ebffa942adca99b36d1)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
M
Miss Islington (bot) committed
d2aaf818aefb217029371cf660cc10bd63726730
Parent: 99da75e
Committed by GitHub <noreply@github.com> on 1/21/2023, 10:54:09 AM