summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorSergey B Kirpichev <skirpichev@gmail.com>2024-10-10 12:42:03 (GMT)
committerGitHub <noreply@github.com>2024-10-10 12:42:03 (GMT)
commit87d7315ac57250046372b0d9ae4619ba619c8c87 (patch)
tree3faebb9b68976d101e1f0433f4c8eb1e3e65c4b1 /Misc
parente4cab488d4445e8444932f3bed1c329c0d9e5038 (diff)
downloadcpython-87d7315ac57250046372b0d9ae4619ba619c8c87.zip
cpython-87d7315ac57250046372b0d9ae4619ba619c8c87.tar.gz
cpython-87d7315ac57250046372b0d9ae4619ba619c8c87.tar.bz2
gh-125118: don't copy arbitrary values to _Bool in the struct module (GH-125169)
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. Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Petr Viktorin <encukou@gmail.com>
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2024-10-09-07-09-00.gh-issue-125118.J9rQ1S.rst1
1 files changed, 1 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2024-10-09-07-09-00.gh-issue-125118.J9rQ1S.rst b/Misc/NEWS.d/next/Library/2024-10-09-07-09-00.gh-issue-125118.J9rQ1S.rst
new file mode 100644
index 0000000..5d57cdb
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2024-10-09-07-09-00.gh-issue-125118.J9rQ1S.rst
@@ -0,0 +1 @@
+Don't copy arbitrary values to :c:expr:`_Bool` in the :mod:`struct` module.