Correct a crash if the length buffer is NULL.

This commit is contained in:
Aric Stewart 2005-06-07 20:02:07 +00:00 committed by Alexandre Julliard
parent fbc7a40273
commit 90bc168c87

View File

@ -971,11 +971,16 @@ INSTALLSTATE WINAPI MsiGetComponentPathA(LPCSTR szProduct, LPCSTR szComponent,
}
if( pcchBuf && *pcchBuf > 0 )
{
lpwPathBuf = HeapAlloc( GetProcessHeap(), 0, *pcchBuf * sizeof(WCHAR));
incoming_len = *pcchBuf;
}
else
{
lpwPathBuf = NULL;
incoming_len = 0;
}
incoming_len = *pcchBuf;
rc = MsiGetComponentPathW(szwProduct, szwComponent, lpwPathBuf, pcchBuf);
HeapFree( GetProcessHeap(), 0, szwProduct);