From: Gregory P. Smith Date: Sat, 23 Mar 2013 23:05:36 +0000 (-0700) Subject: Fixes issue4653 - Correctly specify the buffer size to FormatMessageW and X-Git-Tag: v3.4.0a1~1099^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b803c6c4b8d6256ac3d69f07f28c5c7024c3d4f5;p=thirdparty%2FPython%2Fcpython.git Fixes issue4653 - Correctly specify the buffer size to FormatMessageW and correctly check for errors on two CreateFileMapping calls. --- diff --git a/PC/bdist_wininst/extract.c b/PC/bdist_wininst/extract.c index c900f235fd91..aec8eda2be85 100644 --- a/PC/bdist_wininst/extract.c +++ b/PC/bdist_wininst/extract.c @@ -127,7 +127,7 @@ char *map_new_file(DWORD flags, char *filename, CloseHandle(hFile); - if (hFileMapping == INVALID_HANDLE_VALUE) { + if (hFileMapping == NULL) { if (notify) notify(SYSTEM_ERROR, "CreateFileMapping (%s)", filename); diff --git a/PC/bdist_wininst/install.c b/PC/bdist_wininst/install.c index 771922cfd646..c11d45de2223 100644 --- a/PC/bdist_wininst/install.c +++ b/PC/bdist_wininst/install.c @@ -1019,7 +1019,7 @@ static char *MapExistingFile(char *pathname, DWORD *psize) NULL, PAGE_READONLY, 0, 0, NULL); CloseHandle(hFile); - if (hFileMapping == INVALID_HANDLE_VALUE) + if (hFileMapping == NULL) return NULL; data = MapViewOfFile(hFileMapping, diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 25b6680b3b78..edb6038e3bfb 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -235,7 +235,7 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname, SUBLANG_DEFAULT), /* Default language */ theInfo, /* the buffer */ - sizeof(theInfo), /* the buffer size */ + sizeof(theInfo) / sizeof(wchar_t), /* size in wchars */ NULL); /* no additional format args. */ /* Problem: could not get the error message.