File tree 1 file changed +8
-4
lines changed
CoreFoundation/URL.subproj
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -280,9 +280,11 @@ CF_EXPORT CFStringRef _CFStringCreateByAddingPercentEncodingWithAllowedCharacter
280
280
}
281
281
else {
282
282
// not big enough? malloc it.
283
- size_t mallocSize ;
283
+ CFIndex mallocSize ;
284
284
if ( _CFMultiplyBufferSizeWithoutOverflow (maxBufferSize , 4 , & mallocSize ) ) {
285
- inBuf = (UInt8 * )malloc (mallocSize );
285
+ if (mallocSize >= 0 ) {
286
+ inBuf = (UInt8 * )malloc (mallocSize );
287
+ }
286
288
}
287
289
}
288
290
if ( inBuf ) {
@@ -455,9 +457,11 @@ CF_EXPORT CFStringRef _CFStringCreateByRemovingPercentEncoding(CFAllocatorRef al
455
457
}
456
458
else {
457
459
// not big enough? malloc it.
458
- size_t mallocSize ;
460
+ CFIndex mallocSize ;
459
461
if ( _CFMultiplyBufferSizeWithoutOverflow (maxBufferSize , 2 , & mallocSize ) ) {
460
- encodedBuf = (UInt8 * )malloc (mallocSize );
462
+ if (mallocSize >= 0 ) {
463
+ encodedBuf = (UInt8 * )malloc (mallocSize );
464
+ }
461
465
}
462
466
}
463
467
if ( encodedBuf ) {
You can’t perform that action at this time.
0 commit comments