Alexandre Julliard : msi: Properly clear the new table data when a column is added.

Alexandre Julliard julliard at winehq.org
Wed Oct 17 09:05:27 CDT 2007


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Oct 17 14:13:53 2007 +0200

msi: Properly clear the new table data when a column is added.

---

 dlls/msi/table.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index bf7d705..0193649 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -1041,10 +1041,11 @@ static UINT get_tablecolumns( MSIDATABASE *db,
 static void msi_update_table_columns( MSIDATABASE *db, LPCWSTR name )
 {
     MSITABLE *table;
-    UINT size, offset;
+    UINT size, offset, old_count;
     int n;
 
     table = find_cached_table( db, name );
+    old_count = table->col_count;
     msi_free( table->colinfo );
     table_get_column_info( db, name, &table->colinfo, &table->col_count );
 
@@ -1054,7 +1055,8 @@ static void msi_update_table_columns( MSIDATABASE *db, LPCWSTR name )
     for ( n = 0; n < table->row_count; n++ )
     {
         table->data[n] = msi_realloc( table->data[n], size );
-        table->data[n][offset] = (BYTE)MSI_NULL_INTEGER;
+        if (old_count < table->col_count)
+            memset( &table->data[n][offset], 0, size - offset );
     }
 }
 




More information about the wine-cvs mailing list