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 ronaldoussoren
Recipients ned.deily, ronaldoussoren
Date 2012-08-22.08:59:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1345625951.66.0.642998232013.issue15761@psf.upfronthosting.co.za>
In-reply-to
Content
There could be an off by one error in the decoding of PYTHONEXECUTABLE, mbstowcs will only add a NUL character when there is room for one and when the environment variable is all ASCII the buffer isn't large enough which means the argument to Py_SetProgramName is not NUL-terminated unless there happens to be a NUL byte just beyond the allocated buffer.

The attached patch ensures that there is room for a NUL character. I don't know if this actually fixes the crash as I've been unable to reproduce the issue (with various values of PYTHONEXECUBLE and with/without malloc checking environment variables (see malloc(3)).
History
Date User Action Args
2012-08-22 08:59:11ronaldoussorensetrecipients: + ronaldoussoren, ned.deily
2012-08-22 08:59:11ronaldoussorensetmessageid: <1345625951.66.0.642998232013.issue15761@psf.upfronthosting.co.za>
2012-08-22 08:59:11ronaldoussorenlinkissue15761 messages
2012-08-22 08:59:10ronaldoussorencreate