mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix bug reported by static analyser - NSData was testing ivars instead of arguments in -initWithBytesNoCopy:length:freeWhenDone:. The correct behaviour was to throw an exception if passed a NULL pointer and a length. The actual behaviour was to test whether the data object was invalid. This could lead to accidental NULL-pointer dereferencing later.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32030 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
021d3680d7
commit
2edfea16be
1 changed files with 1 additions and 1 deletions
|
@ -2526,7 +2526,7 @@ failure:
|
|||
length: (NSUInteger)bufferSize
|
||||
freeWhenDone: (BOOL)shouldFree
|
||||
{
|
||||
if (bytes == 0 && length > 0)
|
||||
if (aBuffer == 0 && bufferSize > 0)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[%@-initWithBytesNoCopy:length:freeWhenDone:] called with "
|
||||
|
|
Loading…
Reference in a new issue