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

Alexandre Julliard julliard at winehq.org
Tue Oct 7 08:54:11 CDT 2008


Module: wine
Branch: master
Commit: e88b09a3421a2cb72d03f8a591c38e8deced5796
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e88b09a3421a2cb72d03f8a591c38e8deced5796

Author: James Hawkins <jhawkins at codeweavers.com>
Date:   Tue Oct  7 01:52:00 2008 -0500

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 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index edd0519..0309165 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;
 




More information about the wine-cvs mailing list