msi: Avoid a null pointer dereference.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e76b42c096
commit
b4c39f4e7c
|
@ -778,6 +778,11 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
|
||||||
lstrcatW( path, file );
|
lstrcatW( path, file );
|
||||||
|
|
||||||
data = msi_read_text_archive( path, &len );
|
data = msi_read_text_archive( path, &len );
|
||||||
|
if (!data)
|
||||||
|
{
|
||||||
|
msi_free(path);
|
||||||
|
return ERROR_FUNCTION_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
ptr = data;
|
ptr = data;
|
||||||
msi_parse_line( &ptr, &columns, &num_columns, &len );
|
msi_parse_line( &ptr, &columns, &num_columns, &len );
|
||||||
|
|
|
@ -2369,6 +2369,12 @@ static void test_msiimport(void)
|
||||||
r = MsiOpenDatabaseW(msifileW, MSIDBOPEN_CREATE, &hdb);
|
r = MsiOpenDatabaseW(msifileW, MSIDBOPEN_CREATE, &hdb);
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
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);
|
r = add_table_to_db(hdb, test_data);
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue