Commit 7a78ca04 authored by Stefan Leichter's avatar Stefan Leichter Committed by Alexandre Julliard

GetPrinterDriverDirectoryA: do not crash on null pointers.

parent 242e395b
......@@ -2507,10 +2507,11 @@ BOOL WINAPI GetPrinterDriverDirectoryA(LPSTR pName, LPSTR pEnvironment,
if (ret) {
ret = WideCharToMultiByte( CP_ACP, 0, driverDirectoryW, -1,
pDriverDirectory, cbBuf, NULL, NULL);
*pcbNeeded = WideCharToMultiByte( CP_ACP, 0, driverDirectoryW, -1,
NULL, 0, NULL, NULL);
if(pcbNeeded)
*pcbNeeded = WideCharToMultiByte( CP_ACP, 0, driverDirectoryW, -1,
NULL, 0, NULL, NULL);
} else
*pcbNeeded = pcbNeededW * sizeof(CHAR)/sizeof(WCHAR);
if(pcbNeeded) *pcbNeeded = pcbNeededW * sizeof(CHAR)/sizeof(WCHAR);
TRACE("provided<%ld> required <%ld>\n", cbBuf, *pcbNeeded);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment