Be sure to null terminate the string in MsiGetProductInfoA after the
W->A conversion using MsiGetProductInfoW if there is space.
This commit is contained in:
parent
e415baadfc
commit
685aa44b2d
|
@ -500,8 +500,13 @@ UINT WINAPI MsiGetProductInfoA(LPCSTR szProduct, LPCSTR szAttribute,
|
|||
&pcchwValueBuf );
|
||||
|
||||
if( ERROR_SUCCESS == r )
|
||||
{
|
||||
INT old_len = *pcchValueBuf;
|
||||
*pcchValueBuf = WideCharToMultiByte(CP_ACP, 0, szwBuffer, pcchwValueBuf,
|
||||
szBuffer, *pcchValueBuf, NULL, NULL);
|
||||
if (old_len > *pcchValueBuf)
|
||||
szBuffer[*pcchValueBuf]=0;
|
||||
}
|
||||
|
||||
end:
|
||||
HeapFree( GetProcessHeap(), 0, szwProduct );
|
||||
|
|
Loading…
Reference in New Issue