Index: README ================================================================== --- README +++ README @@ -22,12 +22,12 @@ BUILDING AS A MAC OS X FRAMEWORK It is also possible to build ObjFW as a Mac OS X framework. To do so, - just execute xcodebuild in the root directory of ObjFW or open the - .xcodeproj in Xcode and choose Build -> Build from the menu. Copy the + just execute xcodebuild -target ObjFW in the root directory of ObjFW or open + the .xcodeproj in Xcode and choose Build -> Build from the menu. Copy the resulting ObjFW.framework to /Library/Frameworks and you are done. USING THE MAC OS X FRAMWORK IN XCODE Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -664,17 +664,20 @@ if (stat([path cString], &s) == -1) @throw [OFOpenFileFailedException newWithClass: isa path: path mode: @"rb"]; + if (s.st_size > SIZE_MAX) + @throw [OFOutOfRangeException newWithClass: isa]; + file = [[OFFile alloc] initWithPath: path mode: @"rb"]; @try { - tmp = [self allocMemoryWithSize: s.st_size]; + tmp = [self allocMemoryWithSize: (size_t)s.st_size]; - [file readExactlyNBytes: s.st_size + [file readExactlyNBytes: (size_t)s.st_size intoBuffer: tmp]; } @finally { [file release]; } } @catch (id e) { @@ -682,11 +685,11 @@ @throw e; } self = [self initWithCString: tmp encoding: encoding - length: s.st_size]; + length: (size_t)s.st_size]; [self freeMemory: tmp]; return self; }