Author: fredkiefer
Date: Sat Oct  3 21:50:03 2015
New Revision: 39025

URL: http://svn.gna.org/viewcvs/gnustep?rev=39025&view=rev
Log:
        * Source/NSPropertyList.m (GSBinaryPLGenerator-storeCount:): Use
        0x12 instead of 0x13 for integer count.
        * Source/NSPropertyList.m (GSBinaryPLParser-readCountAt:):
        * Handle
        0x12 correctly. Use same code for 0x13 to read old incorrect
        written data.
        Based on change by Josh Freeman <[email protected]>

Modified:
    libs/base/trunk/ChangeLog
    libs/base/trunk/Source/NSPropertyList.m

Modified: libs/base/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=39025&r1=39024&r2=39025&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog   (original)
+++ libs/base/trunk/ChangeLog   Sat Oct  3 21:50:03 2015
@@ -1,3 +1,12 @@
+2015-10-03  Fred Kiefer <[email protected]>
+
+       * Source/NSPropertyList.m (GSBinaryPLGenerator-storeCount:): Use
+       0x12 instead of 0x13 for integer count.
+       * Source/NSPropertyList.m (GSBinaryPLParser-readCountAt:): Handle
+       0x12 correctly. Use same code for 0x13 to read old incorrect
+       written data.
+       Based on change by Josh Freeman <[email protected]>
+
 2015-09-23  Wolfgang Lux  <[email protected]>
 
        * Source/NSXMLParser.m:

Modified: libs/base/trunk/Source/NSPropertyList.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSPropertyList.m?rev=39025&r1=39024&r2=39025&view=diff
==============================================================================
--- libs/base/trunk/Source/NSPropertyList.m     (original)
+++ libs/base/trunk/Source/NSPropertyList.m     Sat Oct  3 21:50:03 2015
@@ -2981,14 +2981,15 @@
       *counter = pos;
       return count;
     }
-  else if ((c > 0x11) && (c <= 0x13))
-    {
-      unsigned len = c - 0x10;
-
-NSAssert(pos + 1 < _length, NSInvalidArgumentException);
+  // FIXME: Handling for 0x13 is wrong, but this value will only
+  // show up for incorrect old GNUstep property lists.
+  else if ((c == 0x12) || (c == 0x13))
+    {
+      unsigned len = 4;
+
+NSAssert(pos + 4 < _length, NSInvalidArgumentException);
       count = _bytes[pos++];
-NSAssert(pos + count < _length, NSInvalidArgumentException);
-      while (len-- > 0)
+      while (--len > 0)
         {
           count = (count << 8) + _bytes[pos++];
         }
@@ -3715,7 +3716,7 @@
     }
   else
     {
-      code = 0x13;
+      code = 0x12;
       [dest appendBytes: &code length: 1];
       count = NSSwapHostIntToBig(count);
       [dest appendBytes: &count length: 4];


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to