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

msi: Don't update the table columns if there are no more columns.

This should fix the heap corruption that caused intermittent crashes for patchwatcher.
parent 7cd67368
......@@ -585,6 +585,8 @@ static UINT table_get_column_info( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINFO
if( r != ERROR_SUCCESS )
return r;
*pcount = column_count;
/* if there's no columns, there's no table */
if( column_count == 0 )
return ERROR_INVALID_PARAMETER;
......@@ -603,7 +605,6 @@ static UINT table_get_column_info( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINFO
}
*pcols = columns;
*pcount = column_count;
return r;
}
......@@ -1034,6 +1035,9 @@ static void msi_update_table_columns( MSIDATABASE *db, LPCWSTR name )
msi_free( table->colinfo );
table_get_column_info( db, name, &table->colinfo, &table->col_count );
if (!table->col_count)
return;
size = msi_table_get_row_size( db, table->colinfo, table->col_count );
offset = table->colinfo[table->col_count - 1].offset;
......
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