mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
fix potential null pointer deref
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36840 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d65b9254dd
commit
b71fde4e19
1 changed files with 33 additions and 27 deletions
|
@ -525,8 +525,11 @@ _GSDebugAllocationList(BOOL difference)
|
|||
buf = NSZoneMalloc(NSDefaultMallocZone(), siz);
|
||||
}
|
||||
|
||||
if (buf)
|
||||
if (0 == buf)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
pos = 0;
|
||||
for (i = 0; i < num_classes; i++)
|
||||
{
|
||||
|
@ -545,7 +548,7 @@ _GSDebugAllocationList(BOOL difference)
|
|||
pos += strlen(&buf[pos]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
@ -612,8 +615,11 @@ _GSDebugAllocationListAll(void)
|
|||
buf = NSZoneMalloc(NSDefaultMallocZone(), siz);
|
||||
}
|
||||
|
||||
if (buf)
|
||||
if (0 == buf)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
pos = 0;
|
||||
for (i = 0; i < num_classes; i++)
|
||||
{
|
||||
|
@ -626,7 +632,7 @@ _GSDebugAllocationListAll(void)
|
|||
pos += strlen(&buf[pos]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue