Kaydet (Commit) 058bde19 authored tarafından Neal Norwitz's avatar Neal Norwitz

SF Patch #1297028, cjkcodecs does not initialize type pointer

Fix segfault.  I tried to write a test, but it wouldn't crash
when running regrtest.  This really should have some sort of test.

Should definitely be backported.
üst 2190f8c4
......@@ -149,6 +149,9 @@ present).
Extension Modules
-----------------
- Patch #1297028: fix segfault if call type on MultibyteCodec,
MultibyteStreamReader, or MultibyteStreamWriter
- Fix memory leak in posix.access().
- Patch #1213831: Fix typo in unicodedata._getcode.
......
......@@ -1265,6 +1265,10 @@ static struct PyMethodDef __methods[] = {
void
init_multibytecodec(void)
{
MultibyteCodec_Type.ob_type = &PyType_Type;
MultibyteStreamReader_Type.ob_type = &PyType_Type;
MultibyteStreamWriter_Type.ob_type = &PyType_Type;
Py_InitModule("_multibytecodec", __methods);
if (PyErr_Occurred())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment