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:
Aric Stewart 2005-09-06 14:04:25 +00:00 committed by Alexandre Julliard
parent e415baadfc
commit 685aa44b2d
1 changed files with 5 additions and 0 deletions

View File

@ -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 );