Commit 39b841d1 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msi: Fix a buffer overrun.

parent 48848155
......@@ -1812,17 +1812,17 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIREC
{
WCHAR template_s[1024];
WCHAR *template_rec, *template;
DWORD length;
LoadStringW(msi_hInstance, IDS_INFO, template_s, 1024);
res = MSI_RecordGetStringW(record, 0, NULL, &length);
res = MSI_RecordGetStringW(record, 0, NULL, &len);
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
return res;
len++;
template_rec = msi_alloc(len * sizeof(WCHAR));
if (!template_rec) return ERROR_OUTOFMEMORY;
MSI_RecordGetStringW(record, 0, template_rec, &length);
MSI_RecordGetStringW(record, 0, template_rec, &len);
len++;
template = msi_alloc((len + strlenW(template_s)) * sizeof(WCHAR));
if (!template) return ERROR_OUTOFMEMORY;
......
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