mirror of
https://github.com/python/cpython.git
synced 2025-08-09 11:29:45 +00:00
[3.11] gh-98783: Fix crashes when str
subclasses are used in _PyUnicode_Equal
(GH-98806) (#98871)
* gh-98783: Fix crashes when `str` subclasses are used in `_PyUnicode_Equal` (GH-98806)
(cherry picked from commit 76f989dc3e
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
a55bd6f884
commit
5efe2eead3
4 changed files with 35 additions and 2 deletions
|
@ -11134,8 +11134,8 @@ unicode_compare_eq(PyObject *str1, PyObject *str2)
|
|||
int
|
||||
_PyUnicode_Equal(PyObject *str1, PyObject *str2)
|
||||
{
|
||||
assert(PyUnicode_CheckExact(str1));
|
||||
assert(PyUnicode_CheckExact(str2));
|
||||
assert(PyUnicode_Check(str1));
|
||||
assert(PyUnicode_Check(str2));
|
||||
if (str1 == str2) {
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue