mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Check for corrupt archive or unsupported number types as suggested by Fred
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39609 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d40d219015
commit
bc7634464d
1 changed files with 9 additions and 3 deletions
|
@ -1033,7 +1033,7 @@ if (aValue >= -1 && aValue <= 12)\
|
|||
double doublebuf;
|
||||
void *buffer;
|
||||
|
||||
[coder encodeValueOfObjCType: @encode (char) at: type];
|
||||
[coder encodeValueOfObjCType: @encode(char) at: type];
|
||||
|
||||
switch (type[0])
|
||||
{
|
||||
|
@ -1056,6 +1056,9 @@ if (aValue >= -1 && aValue <= 12)\
|
|||
buffer = &floatbuf; break;
|
||||
case 'd':
|
||||
buffer = &doublebuf; break;
|
||||
default:
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"unknown NSNumber type '%s'", type];
|
||||
}
|
||||
|
||||
[self getValue: buffer];
|
||||
|
@ -1080,7 +1083,7 @@ if (aValue >= -1 && aValue <= 12)\
|
|||
double doublebuf;
|
||||
void *buffer;
|
||||
|
||||
[coder decodeValueOfObjCType: @encode (char) at: type];
|
||||
[coder decodeValueOfObjCType: @encode(char) at: type];
|
||||
switch (type[0])
|
||||
{
|
||||
case 'c':
|
||||
|
@ -1102,7 +1105,10 @@ if (aValue >= -1 && aValue <= 12)\
|
|||
buffer = &floatbuf; break;
|
||||
case 'd':
|
||||
buffer = &doublebuf; break;
|
||||
}
|
||||
default:
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"unknown NSNumber type '%c'", type[0]];
|
||||
}
|
||||
[coder decodeValueOfObjCType: type at: buffer];
|
||||
return [self initWithBytes: buffer objCType: type];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue