classification
Title: Use Py_XDECREF() instead of Py_DECREF() in MultibyteCodec and MultibyteStreamReader
Type: Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, haypo
Priority: normal Keywords: patch

Created on 2008-07-06 18:27 by haypo, last changed 2008-07-16 22:04 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
multibytecodec_py_xdecref.patch haypo, 2008-07-06 18:27 Patch to fix described bugs
Messages (2)
msg69347 - (view) Author: STINNER Victor (haypo) * (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
2008-07-16 22:04:28georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg69844
nosy: + georg.brandl
2008-07-06 18:27:39haypocreate