Commit c2d66da6 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

msi: Don't crash if record has no fields.

parent 46e2d795
......@@ -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");
......
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