New submission from STINNER Victor <[EMAIL PROTECTED]>:

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)

----------
components: Library (Lib)
files: multibytecodec_py_xdecref.patch
keywords: patch
messages: 69347
nosy: haypo
severity: normal
status: open
title: Use Py_XDECREF() instead of Py_DECREF() in MultibyteCodec and 
MultibyteStreamReader
versions: Python 2.6
Added file: http://bugs.python.org/file10834/multibytecodec_py_xdecref.patch

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3305>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to