SIGN IN SIGN UP

[3.13] gh-71810: Fix _PyLong_AsByteArray() undefined behavior (GH-138873) (#138884)

gh-71810: Fix _PyLong_AsByteArray() undefined behavior (GH-138873)

Don't read p[-1] when p is an empty string: when n==0.
(cherry picked from commit 8b5ce31c2b44d9bf82e6119e90a52dd530bfd1db)

Co-authored-by: Victor Stinner <vstinner@python.org>
M
Miss Islington (bot) committed
a9020589de6321310720ca550f48793ab5b42d93
Parent: a5f7e02
Committed by GitHub <noreply@github.com> on 9/14/2025, 9:49:23 AM