mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
fix for bug #42483
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37934 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c33c21b27a
commit
245e957635
4 changed files with 22 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
2014-06-01 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Additions/Unicode.m: Fix buffer overrun.
|
||||
* Source/GSString.m: Fix uninitialised variable.
|
||||
Cure for bug #42483
|
||||
|
||||
2014-05-28 Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
* Source/NSUndoManager.m
|
||||
Assert sig is not null in registerUndoWithTarget:selector:object:
|
||||
|
|
|
@ -2068,9 +2068,9 @@ bases:
|
|||
uint8_t *tmp;
|
||||
|
||||
#if GS_WITH_GC
|
||||
tmp = NSAllocateCollectable(slen, 0);
|
||||
tmp = NSAllocateCollectable(slen + extra, 0);
|
||||
#else
|
||||
tmp = NSZoneMalloc(zone, slen);
|
||||
tmp = NSZoneMalloc(zone, slen + extra);
|
||||
if (ptr != buf && ptr != *dst)
|
||||
{
|
||||
NSZoneFree(zone, ptr);
|
||||
|
|
|
@ -1806,7 +1806,7 @@ compare_u(GSStr self, NSString *aString, unsigned mask, NSRange aRange)
|
|||
static inline const char*
|
||||
cString_c(GSStr self, NSStringEncoding enc)
|
||||
{
|
||||
unsigned char *r;
|
||||
unsigned char *r = 0;
|
||||
|
||||
if (self->_count == 0)
|
||||
{
|
||||
|
|
|
@ -256,8 +256,20 @@ int main()
|
|||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSString *str;
|
||||
NSString *sub;
|
||||
char buf[10];
|
||||
const char *ptr;
|
||||
char buf[10];
|
||||
|
||||
str = @"a";
|
||||
while ([str length] < 30000)
|
||||
{
|
||||
str = [str stringByAppendingString: str];
|
||||
}
|
||||
if (0 == [str length] % 2)
|
||||
{
|
||||
str = [str stringByAppendingString: @"x"];
|
||||
}
|
||||
ptr = [str cStringUsingEncoding: NSASCIIStringEncoding];
|
||||
|
||||
PASS_EXCEPTION([NSString stringWithUTF8String: 0],
|
||||
NSInvalidArgumentException,
|
||||
"stringWithUTF8String raises for NULL");
|
||||
|
|
Loading…
Reference in a new issue