diff --git a/dlls/msi/table.c b/dlls/msi/table.c index 1a3ccb2c112..57cd4df9746 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -686,7 +686,7 @@ string_table *load_string_table( IStorage *stg ) CHAR *data = NULL; USHORT *pool = NULL; UINT r, datasize = 0, poolsize = 0, codepage; - DWORD i, count, offset, len, n; + DWORD i, count, offset, len, n, refs; static const WCHAR szStringData[] = { '_','S','t','r','i','n','g','D','a','t','a',0 }; static const WCHAR szStringPool[] = { @@ -708,38 +708,51 @@ string_table *load_string_table( IStorage *stg ) offset = 0; n = 1; - for( i=1; i datasize ) + if ( (offset + len) > datasize ) { ERR("string table corrupt?\n"); break; } - /* don't add the high word of a string's length as a string */ - if ( len || !pool[i*2+1] ) - { - r = msi_addstring( st, n, data+offset, len, pool[i*2+1] ); - if( r != n ) - ERR("Failed to add string %ld\n", n ); - n++; - } - + r = msi_addstring( st, n, data+offset, len, refs ); + if( r != n ) + ERR("Failed to add string %ld\n", n ); + n++; offset += len; } if ( datasize != offset ) - ERR("string table load failed! (%08x != %08lx)\n", datasize, offset ); + ERR("string table load failed! (%08x != %08lx), please report\n", datasize, offset ); TRACE("Loaded %ld strings\n", count);