mirror of
https://github.com/reactos/wine.git
synced 2025-02-13 08:44:54 +00:00
msi: Don't crash if record has no fields.
This commit is contained in:
parent
46e2d79508
commit
c2d66da665
@ -626,8 +626,8 @@ UINT MSI_FormatRecordW( MSIPACKAGE* package, MSIRECORD* record, LPWSTR buffer,
|
|||||||
|
|
||||||
TRACE("(%s)\n",debugstr_w(rec));
|
TRACE("(%s)\n",debugstr_w(rec));
|
||||||
|
|
||||||
len = deformat_string_internal(package,rec,&deformated,strlenW(rec),
|
len = deformat_string_internal(package,rec,&deformated,
|
||||||
record, NULL);
|
rec ? strlenW(rec) : 0, record, NULL);
|
||||||
|
|
||||||
if (buffer)
|
if (buffer)
|
||||||
{
|
{
|
||||||
|
@ -388,6 +388,17 @@ static void test_formatrecord(void)
|
|||||||
r = MsiFormatRecord(0, 0, NULL, NULL );
|
r = MsiFormatRecord(0, 0, NULL, NULL );
|
||||||
ok( r == ERROR_INVALID_HANDLE, "wrong error\n");
|
ok( r == ERROR_INVALID_HANDLE, "wrong error\n");
|
||||||
|
|
||||||
|
hrec = MsiCreateRecord(0);
|
||||||
|
ok( hrec, "failed to create record\n");
|
||||||
|
|
||||||
|
/* format an empty record on a record with no parameters */
|
||||||
|
sz = sizeof(buffer);
|
||||||
|
r = MsiFormatRecordA(0, hrec, buffer, &sz );
|
||||||
|
ok( r == ERROR_SUCCESS, "format failed\n");
|
||||||
|
ok( sz == 0, "size wrong\n");
|
||||||
|
|
||||||
|
MsiCloseHandle( hrec );
|
||||||
|
|
||||||
hrec = MsiCreateRecord(4);
|
hrec = MsiCreateRecord(4);
|
||||||
ok( hrec, "failed to create record\n");
|
ok( hrec, "failed to create record\n");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user