From 685aa44b2d6e1ea1e566b79be7ec5e5446ded587 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Tue, 6 Sep 2005 14:04:25 +0000 Subject: [PATCH] Be sure to null terminate the string in MsiGetProductInfoA after the W->A conversion using MsiGetProductInfoW if there is space. --- dlls/msi/msi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index a7ed9308b9..d9262ce0b3 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -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 );