check for null pointer

This commit is contained in:
Richard Frith-Macdonald 2018-01-31 14:24:46 +00:00
parent 9a8c3486ff
commit 9d21ee5671

View file

@ -1401,7 +1401,12 @@ fixBOM(unsigned char **bytes, NSUInteger*length, BOOL *owned,
}
return (id)@"";
}
if (0 == bytes)
{
[NSException raise: NSInvalidArgumentException
format: @"-%@ given NULL pointer",
NSStringFromSelector(_cmd)];
}
fixBOM((unsigned char**)&bytes, &length, &flag, encoding);
if (encoding == NSUnicodeStringEncoding)
{