This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients ajaksu2, christian.heimes
Date 2008-08-24.20:06:57
SpamBayes Score 8.628293e-06
Marked as misclassified No
Message-id <1219608419.12.0.820933037446.issue3662@psf.upfronthosting.co.za>
In-reply-to
Content
The FileIO construct segfaults because PyArg_ParseTupleAndKeywords()
sets name to an invalid but non NULL value. PyMem_Free() tries to
deallocate name but fails.

Suggestion: Either appy this patch or change
PyArg_ParseTupleAndKeyword()'s behavior for 'e'.

Index: Modules/_fileio.c
===================================================================
--- Modules/_fileio.c   (Revision 66010)
+++ Modules/_fileio.c   (Arbeitskopie)
@@ -174,8 +174,10 @@
                if (!PyArg_ParseTupleAndKeywords(args, kwds, "et|si:fileio",
                                                 kwlist,
                                                
Py_FileSystemDefaultEncoding,
-                                                &name, &mode, &closefd))
+                                                &name, &mode, &closefd)) {
+                       name = NULL;
                        goto error;
+                       }
            }
        }
History
Date User Action Args
2008-08-24 20:06:59christian.heimessetrecipients: + christian.heimes, ajaksu2
2008-08-24 20:06:59christian.heimessetmessageid: <1219608419.12.0.820933037446.issue3662@psf.upfronthosting.co.za>
2008-08-24 20:06:58christian.heimeslinkissue3662 messages
2008-08-24 20:06:57christian.heimescreate