* Source/GSFormat.m: Call va_end with the correct parameter.

* Source/NSObject+NSComparisonMethods.m: Add missing return.
* Source/GSString.m (-replaceCharactersInRange:withString:,
-initWithBytesNoCopy:...freeWhenDone:): Remove dead code.
* Source/NSDistantObject.m (-initWithCoder:): Remove dead code.
* Source/NSPredicate.m (_eval_avg:): Don't devide by zero.
Fix issues found by Coverity.
This commit is contained in:
fredkiefer 2018-02-01 22:31:15 +01:00
parent db8b06b47c
commit e69450400a
6 changed files with 19 additions and 5 deletions

View file

@ -1,3 +1,13 @@
2018-02-01 Fred Kiefer <fredkiefer@gmx.de>
* Source/GSFormat.m: Call va_end with the correct parameter.
* Source/NSObject+NSComparisonMethods.m: Add missing return.
* Source/GSString.m (-replaceCharactersInRange:withString:,
-initWithBytesNoCopy:...freeWhenDone:): Remove dead code.
* Source/NSDistantObject.m (-initWithCoder:): Remove dead code.
* Source/NSPredicate.m (_eval_avg:): Don't devide by zero.
Fix issues found by Coverity.
2018-01-26 Richard Frith-Macdonald <rfm@gnu.org>
* NSCharacterSets/GNUmakefile:

View file

@ -1948,7 +1948,7 @@ all_done:
if (workend_malloced) free(workend);
/* Unlock the stream. */
#ifdef __va_copy
va_end(ap);
va_end(ap_save);
#endif
return;
}

View file

@ -1428,7 +1428,7 @@ fixBOM(unsigned char **bytes, NSUInteger*length, BOOL *owned,
{
if (encoding == NSASCIIStringEncoding)
{
if (flag == YES && chars.c != 0)
if (flag == YES)
{
NSZoneFree(NSZoneFromPointer(chars.c), chars.c);
}
@ -5350,7 +5350,7 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException);
}
else
{
length = (aString == nil) ? 0 : [aString length];
length = [aString length];
}
}
offset = length - aRange.length;

View file

@ -222,7 +222,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder
if (debug_proxy)
{
NSLog(@"Local object is %p (%p)\n",
(void*)(uintptr_t)o, (void*)(uintptr_t)o ? o->_object : 0);
(void*)(uintptr_t)o, o->_object);
}
return RETAIN(o->_object);
}

View file

@ -35,7 +35,7 @@
{
if ([self isKindOfClass: [NSArray class]])
{
[(NSArray *)self containsObject: object];
return [(NSArray *)self containsObject: object];
}
}
return NO;

View file

@ -1664,6 +1664,10 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
sum += [o doubleValue];
count++;
}
if (count == 0)
{
return [NSNumber numberWithDouble: 0.0];
}
return [NSNumber numberWithDouble: sum / count];
}