@@ -1267,11 +1267,12 @@ - (OFString*)substringWithRange: (of_range_t)range { void *pool; OFString *ret; - if (range.location + range.length > [self length]) + if (range.length > SIZE_MAX - range.location || + range.location + range.length > [self length]) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; pool = objc_autoreleasePoolPush(); ret = [[OFString alloc]