changeset: 78703:526c6262d91f branch: 3.2 parent: 78699:019a2390b014 user: Ronald Oussoren date: Wed Aug 22 14:24:14 2012 +0200 files: Misc/NEWS Modules/main.c description: Fix for issue 15716: interpreter could crash when PYTHONEXECUTABLE was set on Mac OS X. This is due to an off-by-one error: the allocated buffer didn't have room for a NUL character at the end of the mbstowcs result. diff -r 019a2390b014 -r 526c6262d91f Misc/NEWS --- a/Misc/NEWS Tue Aug 21 23:41:43 2012 +0000 +++ b/Misc/NEWS Wed Aug 22 14:24:14 2012 +0200 @@ -10,6 +10,8 @@ Core and Builtins ----------------- +- Issue #15761: Fix crash when PYTHONEXECUTABLE is set on Mac OS X. + - Issue #15726: Fix incorrect bounds checking in PyState_FindModule. Patch by Robin Schreiber. diff -r 019a2390b014 -r 526c6262d91f Modules/main.c --- a/Modules/main.c Tue Aug 21 23:41:43 2012 +0000 +++ b/Modules/main.c Wed Aug 22 14:24:14 2012 +0200 @@ -616,7 +616,7 @@ script. */ if ((p = Py_GETENV("PYTHONEXECUTABLE")) && *p != '0円') { wchar_t* buffer; - size_t len = strlen(p); + size_t len = strlen(p) + 1; size_t r; buffer = malloc(len * sizeof(wchar_t));

AltStyle によって変換されたページ (->オリジナル) /