SIGN IN SIGN UP

[3.13] gh-125118: don't copy arbitrary values to _Bool in the struct module (GH-125169) (#125263)

memcopy'ing arbitrary values to _Bool variable triggers undefined
behaviour. Avoid this.
We assume that `false` is represented by all zero bytes.

Credits to Alex Gaynor.

(cherry picked from commit 87d7315ac57250046372b0d9ae4619ba619c8c87)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
S
Sergey B Kirpichev committed
c2cb1a89b75f000842bf9626928155172b9ab069
Parent: 0c43d60
Committed by GitHub <noreply@github.com> on 10/10/2024, 2:58:57 PM