Issue 3305: Use Py_XDECREF() instead of Py_DECREF() in MultibyteCodec and MultibyteStreamReader (original) (raw)

Issue3305

Created on 2008-07-06 18:27 by vstinner, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
multibytecodec_py_xdecref.patch vstinner,2008-07-06 18:27 Patch to fix described bugs
Messages (2)
msg69347 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2008-07-06 18:27
Functions mbstreamwriter_dealloc() and mbstreamreader_dealloc() of Modules/cjkcodecs/multibytecodec.c uses Py_DECREF() to free stream attribute memory, but this attribute may be NULL if MultibyteCodec or MultibyteStreamReader constructor fails. Simple fix: use Py_XDECREF(). Example: >>> import _multibytecodec >>> _multibytecodec.MultibyteStreamReader(None) Erreur de segmentation (core dumped)
msg69844 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-16 22:04
Fixed in r65038.
History
Date User Action Args
2022-04-11 14:56:36 admin set github: 47555
2008-07-16 22:04:28 georg.brandl set status: open -> closedresolution: fixedmessages: + nosy: + georg.brandl
2008-07-06 18:27:39 vstinner create