Commit f10365bb authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Don't crash if an empty record is given to MsiProcessMessage.

parent 7edea0cc
......@@ -668,6 +668,10 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType,
action = MSI_RecordGetString(record, 1);
action_text = MSI_RecordGetString(record, 2);
if (!action || !action_text)
return IDOK;
deformat_string(package, action_text, &deformatted);
len = strlenW(timet) + strlenW(action) + strlenW(template_s);
......
......@@ -1360,9 +1360,35 @@ static void test_formatrecord_package(void)
DeleteFile( filename );
}
static void test_processmessage(void)
{
static const CHAR filename[] = "winetest.msi";
MSIHANDLE hrec;
MSIHANDLE package;
int r;
package = helper_createpackage( filename );
ok(package!=0, "Unable to create package\n");
hrec = MsiCreateRecord(3);
ok( hrec, "failed to create record\n");
r = MsiRecordSetString(hrec, 1, "");
ok( r == ERROR_SUCCESS, "set string failed\n");
r = MsiProcessMessage(package, INSTALLMESSAGE_ACTIONSTART, hrec);
ok( r == IDOK, "expected IDOK, got %i\n", r);
MsiCloseHandle(hrec);
MsiCloseHandle(package);
DeleteFile(filename);
}
START_TEST(format)
{
test_createpackage();
test_formatrecord();
test_formatrecord_package();
test_processmessage();
}
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