bpo-36398: Fix a possible crash in structseq_repr(). (GH-12492)
If the first PyUnicode_DecodeUTF8() call fails in structseq_repr(), _PyUnicodeWriter_Dealloc() will be called on an uninitialized _PyUnicodeWriter.
This commit is contained in:
parent
9a0000d15d
commit
93e8012f2c
|
@ -0,0 +1 @@
|
|||
Fix a possible crash in ``structseq_repr()``.
|
|
@ -176,7 +176,7 @@ structseq_repr(PyStructSequence *obj)
|
|||
strlen(typ->tp_name),
|
||||
NULL);
|
||||
if (type_name == NULL) {
|
||||
goto error;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_PyUnicodeWriter_Init(&writer);
|
||||
|
|
Loading…
Reference in New Issue