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));
|
||||
|
||||
len = deformat_string_internal(package,rec,&deformated,strlenW(rec),
|
||||
record, NULL);
|
||||
len = deformat_string_internal(package,rec,&deformated,
|
||||
rec ? strlenW(rec) : 0, record, NULL);
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
|
|
|
@ -388,6 +388,17 @@ static void test_formatrecord(void)
|
|||
r = MsiFormatRecord(0, 0, NULL, NULL );
|
||||
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);
|
||||
ok( hrec, "failed to create record\n");
|
||||
|
||||
|
|
Loading…
Reference in New Issue