* 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 <pikopixel@twilightedge.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39025 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2015-10-03 19:50:03 +00:00
parent 5f6700adcc
commit 7cef72282c
2 changed files with 16 additions and 6 deletions

View file

@ -1,3 +1,12 @@
2015-10-03 Fred Kiefer <fredkiefer@gmx.de>
* 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 <pikopixel@twilightedge.com>
2015-09-23 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSXMLParser.m:

View file

@ -2981,14 +2981,15 @@ NSAssert(pos + 2 < _length, NSInvalidArgumentException);
*counter = pos;
return count;
}
else if ((c > 0x11) && (c <= 0x13))
// 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 = c - 0x10;
unsigned len = 4;
NSAssert(pos + 1 < _length, NSInvalidArgumentException);
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 @@ isEqualFunc(const void *item1, const void *item2,
}
else
{
code = 0x13;
code = 0x12;
[dest appendBytes: &code length: 1];
count = NSSwapHostIntToBig(count);
[dest appendBytes: &count length: 4];