Fix potential OOB in memcmp()
This commit is contained in:
parent
d815f5222f
commit
d22f40f7e9
@ -270,8 +270,10 @@
|
||||
- (BOOL)isEqualToData:(NSData *)data
|
||||
{
|
||||
NSParameterAssert(data);
|
||||
NSParameterAssert(data.length <= _count);
|
||||
|
||||
if (data.length != _count) {
|
||||
return NO;
|
||||
}
|
||||
return !memcmp(_bytes, data.bytes, _count);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user