From e88b09a3421a2cb72d03f8a591c38e8deced5796 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Tue, 7 Oct 2008 01:52:00 -0500 Subject: [PATCH] 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. --- dlls/msi/table.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/msi/table.c b/dlls/msi/table.c index edd05199b10..0309165ebfc 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -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;