Commit b4c39f4e authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msi: Avoid a null pointer dereference.

parent e76b42c0
......@@ -778,6 +778,11 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
lstrcatW( path, file );
data = msi_read_text_archive( path, &len );
if (!data)
{
msi_free(path);
return ERROR_FUNCTION_FAILED;
}
ptr = data;
msi_parse_line( &ptr, &columns, &num_columns, &len );
......
......@@ -2369,6 +2369,12 @@ static void test_msiimport(void)
r = MsiOpenDatabaseW(msifileW, MSIDBOPEN_CREATE, &hdb);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = MsiDatabaseImportA(hdb, CURR_DIR, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
r = MsiDatabaseImportA(hdb, CURR_DIR, "nonexistent");
ok(r == ERROR_FUNCTION_FAILED, "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
r = add_table_to_db(hdb, test_data);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
......
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