File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Crashlytics/FIRCLSUserDefaults Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 11# Unreleased
22
33- [ fixed] Fixed unchecked ` malloc ` s in Crashlytics (#5428 ).
4+ - [ fixed] Fixed an instance of undefined behavior when loading files from disk (#5454 ).
45
56# v4.0.0
67
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ - (void)synchronize {
235235 NSDictionary *state = [self dictionaryRepresentation ];
236236 dispatch_sync (self.synchronizationQueue , ^{
237237#if CLS_TARGET_CAN_WRITE_TO_DISK
238- BOOL isDirectory;
238+ BOOL isDirectory = NO ;
239239 BOOL pathExists = [[NSFileManager defaultManager ] fileExistsAtPath: [self ->_directoryURL path ]
240240 isDirectory: &isDirectory];
241241
@@ -280,7 +280,7 @@ - (NSDictionary *)loadDefaults {
280280 __block NSDictionary *state = nil ;
281281 dispatch_sync (self.synchronizationQueue , ^{
282282#if CLS_TARGET_CAN_WRITE_TO_DISK
283- BOOL isDirectory;
283+ BOOL isDirectory = NO ;
284284 BOOL fileExists = [[NSFileManager defaultManager ] fileExistsAtPath: [self ->_fileURL path ]
285285 isDirectory: &isDirectory];
286286
@@ -289,7 +289,7 @@ - (NSDictionary *)loadDefaults {
289289 if (nil == state) {
290290 FIRCLSErrorLog (@" Failed to read existing UserDefaults file" );
291291 }
292- } else if (!fileExists && !isDirectory ) {
292+ } else if (!fileExists) {
293293 // No file found. This is expected on first launch.
294294 } else if (fileExists && isDirectory) {
295295 FIRCLSErrorLog (@" Found directory where file expected. Removing conflicting directory" );
You can’t perform that action at this time.
0 commit comments