Fix bug dereferencing null pointer under some conditions.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22515 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-02-18 20:53:01 +00:00
parent d873a6f390
commit a531412909
2 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2006-02-18 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSFileManager.m: Fix bug dereferencing nul pointer under
some conditions.
2006-02-17 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSFileManager.m: Implement method to get name of files

View file

@ -231,8 +231,8 @@
*/
@interface GSAttrDictionary : NSDictionary
{
_CHAR *_path;
struct _STATB statbuf;
_CHAR _path[0];
}
+ (NSDictionary*) attributesAt: (const _CHAR*)lpath
traverseLink: (BOOL)traverse;
@ -2746,10 +2746,12 @@ static NSSet *fileKeys = nil;
{
DESTROY(d);
}
d->_path = (_CHAR*)&d[1];
for (i = 0; i <= l; i++)
if (d != nil)
{
d->_path[i] = lpath[i];
for (i = 0; i <= l; i++)
{
d->_path[i] = lpath[i];
}
}
return AUTORELEASE(d);
}