Bugs item #1664966, was opened at 2007-02-21 08:31
Message generated for change (Comment added) made by jhylton
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1664966&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.5
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Stefan Schukat (sschukat)
Assigned to: Jeremy Hylton (jhylton)
Summary: crash in exec statement if uncode filename cannot be decoded

Initial Comment:
In case the exec statement gets an open file with a unicode object in f->f_fp 
the return value of PyString_AsString is not checked for an error and therefore 
a NULL pointer is given to PyRun_File which then leads to a crash.

in ceval.c:
line 4171 ff 

FILE *fp = PyFile_AsFile(prog);
char *name = PyString_AsString(PyFile_Name(prog));
PyCompilerFlags cf;
cf.cf_flags = 0;
if (PyEval_MergeCompilerFlags(&cf))
    v = PyRun_FileFlags(fp, name, Py_file_input, 
                        globals, locals, &cf);
else
    v = PyRun_File(fp, name, Py_file_input, globals,
                                       locals);

Name is NULL after conversion.

Patch would be:

FILE *fp = PyFile_AsFile(prog);
char *name = PyString_AsString(PyFile_Name(prog));
if(name == NULL)
     return -1;
PyCompilerFlags cf;

----------------------------------------------------------------------

>Comment By: Jeremy Hylton (jhylton)
Date: 2007-02-25 15:58

Message:
Logged In: YES 
user_id=31392
Originator: NO

Committed revision 53901.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1664966&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to