]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-36819: Fix crashes in built-in encoders with weird error handlers (GH-28593)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 2 May 2022 09:37:48 +0000 (12:37 +0300)
committerGitHub <noreply@github.com>
Mon, 2 May 2022 09:37:48 +0000 (12:37 +0300)
commit18b07d773e09a2719e69aeaa925d5abb7ba0c068
tree24e00867bcd614057ca886b2e977153d6168fa59
parent614420df9796c8a4f01e24052fc0128b4c20c5bf
bpo-36819: Fix crashes in built-in encoders with weird error handlers (GH-28593)

If the error handler returns position less or equal than the starting
position of non-encodable characters, most of built-in encoders didn't
properly re-size the output buffer. This led to out-of-bounds writes,
and segfaults.
Lib/test/test_codeccallbacks.py
Misc/NEWS.d/next/Core and Builtins/2021-09-28-10-58-30.bpo-36819.cyV50C.rst [new file with mode: 0644]
Objects/stringlib/codecs.h
Objects/unicodeobject.c