Author: dick
Date: 2008-01-23 10:21:15 -0500 (Wed, 23 Jan 2008)
New Revision: 93661

Modified:
   trunk/mono/mono/io-layer/ChangeLog
   trunk/mono/mono/io-layer/versioninfo.c
Log:

2008-01-23  Dick Porter  <[EMAIL PROTECTED]>

        * versioninfo.c (get_string_block): When stepping over the
        StringTable block, do not read an extra block at the end.  Fixes
        the new part of bug 354856.




Modified: trunk/mono/mono/io-layer/ChangeLog
===================================================================
--- trunk/mono/mono/io-layer/ChangeLog  2008-01-23 14:46:41 UTC (rev 93660)
+++ trunk/mono/mono/io-layer/ChangeLog  2008-01-23 15:21:15 UTC (rev 93661)
@@ -1,3 +1,9 @@
+2008-01-23  Dick Porter  <[EMAIL PROTECTED]>
+
+       * versioninfo.c (get_string_block): When stepping over the
+       StringTable block, do not read an extra block at the end.  Fixes
+       the new part of bug 354856.
+
 2008-01-19  Dick Porter  <[EMAIL PROTECTED]>
 
        * versioninfo.c (get_stringtable_block): Cope when the StringTable

Modified: trunk/mono/mono/io-layer/versioninfo.c
===================================================================
--- trunk/mono/mono/io-layer/versioninfo.c      2008-01-23 14:46:41 UTC (rev 
93660)
+++ trunk/mono/mono/io-layer/versioninfo.c      2008-01-23 15:21:15 UTC (rev 
93661)
@@ -433,12 +433,13 @@
 {
        guint16 data_len = block->data_len;
        guint16 string_len = 28; /* Length of the StringTable block */
+       guint16 value_len = 0; /* Length of the previous value data */
        
        /* data_ptr is pointing at an array of one or more String blocks
         * with total length (not including alignment padding) of
         * data_len
         */
-       while (string_len < data_len) {
+       while ((string_len + value_len) < data_len) {
                /* align on a 32-bit boundary */
                data_ptr = (gpointer)((char *)data_ptr + 3);
                data_ptr = (gpointer)((char *)data_ptr - (GPOINTER_TO_INT 
(data_ptr) & 3));
@@ -456,6 +457,7 @@
                }
                
                string_len = string_len + block->data_len;
+               value_len = (block->value_len * 2); /* value given in words not 
bytes */
                
                if (string_key != NULL &&
                    string_value != NULL &&
@@ -554,13 +556,14 @@
 {
        guint16 data_len = block->data_len;
        guint16 string_len = 28; /* Length of the StringTable block */
+       guint16 value_len = 0; /* Length of the previous value data */
        gchar *big_value;
        
        /* data_ptr is pointing at an array of one or more String
         * blocks with total length (not including alignment padding)
         * of data_len
         */
-       while (string_len < data_len) {
+       while ((string_len + value_len) < data_len) {
                /* align on a 32-bit boundary */
                data_ptr = (gpointer)((char *)data_ptr + 3);
                data_ptr = (gpointer)((char *)data_ptr - (GPOINTER_TO_INT 
(data_ptr) & 3));
@@ -578,6 +581,7 @@
                }
                
                string_len = string_len + block->data_len;
+               value_len = (block->value_len * 2); /* value given in words not 
bytes */
                
                big_value = g_convert ((gchar *)block->key,
                                       unicode_chars (block->key) * 2,

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to