Commit 685aa44b authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

Be sure to null terminate the string in MsiGetProductInfoA after the

W->A conversion using MsiGetProductInfoW if there is space.
parent e415baad
...@@ -500,8 +500,13 @@ UINT WINAPI MsiGetProductInfoA(LPCSTR szProduct, LPCSTR szAttribute, ...@@ -500,8 +500,13 @@ UINT WINAPI MsiGetProductInfoA(LPCSTR szProduct, LPCSTR szAttribute,
&pcchwValueBuf ); &pcchwValueBuf );
if( ERROR_SUCCESS == r ) if( ERROR_SUCCESS == r )
{
INT old_len = *pcchValueBuf;
*pcchValueBuf = WideCharToMultiByte(CP_ACP, 0, szwBuffer, pcchwValueBuf, *pcchValueBuf = WideCharToMultiByte(CP_ACP, 0, szwBuffer, pcchwValueBuf,
szBuffer, *pcchValueBuf, NULL, NULL); szBuffer, *pcchValueBuf, NULL, NULL);
if (old_len > *pcchValueBuf)
szBuffer[*pcchValueBuf]=0;
}
end: end:
HeapFree( GetProcessHeap(), 0, szwProduct ); HeapFree( GetProcessHeap(), 0, szwProduct );
......
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