Fix nul pointer deref

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11206 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2001-10-18 15:42:29 +00:00
parent 995473179c
commit 8c09b2719d
3 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2001-10-18 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSString.m: ([+stringWithCString:]) check for nul pointer.
2001-10-17 Adam Fedor <fedor@gnu.org>
* configure.in (GNUSTEP_LDIR): Look for libobjc in

View file

@ -460,7 +460,7 @@ handle_printf_atsign (FILE *stream,
+ (id) stringWithCString: (const char*) byteString
{
NSString *obj;
unsigned length = strlen(byteString);
unsigned length = byteString ? strlen(byteString) : 0;
obj = [self allocWithZone: NSDefaultMallocZone()];
obj = [obj initWithCString: byteString length: length];

View file

@ -637,7 +637,9 @@ NSLog(@"Element '%@' not implemented", name); // FIXME
}
else if ([name isEqual: @"footnote"] == YES)
{
NSLog(@"Element '%@' not implemented", name); // FIXME
[buf appendString: @"<blockquote>"];
[self outputText: children to: buf];
[buf appendString: @"</blockquote>"];
}
else
{