msi: Fix use after free error in TransformView_set_row.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2020-07-01 10:43:00 +02:00 committed by Alexandre Julliard
parent 25d6abb951
commit 6a0a0d2a0b
1 changed files with 5 additions and 1 deletions

View File

@ -2341,7 +2341,7 @@ static UINT TransformView_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT
L"INSERT INTO `_TransformView` (`Table`, `Column`, `Row`, `Data`, `Current`) VALUES ('";
MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
WCHAR buf[256], *query = buf;
WCHAR buf[256], *query;
MSIRECORD *old_rec;
MSIQUERY *q;
WCHAR *key;
@ -2409,6 +2409,10 @@ static UINT TransformView_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT
return ERROR_OUTOFMEMORY;
}
}
else
{
query = buf;
}
memcpy( query, query_pfx, p * sizeof(WCHAR) );
len = wcslen( tv->name );