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 1
1
# Unreleased
2
2
3
3
- [ fixed] Fixed unchecked ` malloc ` s in Crashlytics (#5428 ).
4
+ - [ fixed] Fixed an instance of undefined behavior when loading files from disk (#5454 ).
4
5
5
6
# v4.0.0
6
7
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ - (void)synchronize {
235
235
NSDictionary *state = [self dictionaryRepresentation ];
236
236
dispatch_sync (self.synchronizationQueue , ^{
237
237
#if CLS_TARGET_CAN_WRITE_TO_DISK
238
- BOOL isDirectory;
238
+ BOOL isDirectory = NO ;
239
239
BOOL pathExists = [[NSFileManager defaultManager ] fileExistsAtPath: [self ->_directoryURL path ]
240
240
isDirectory: &isDirectory];
241
241
@@ -280,7 +280,7 @@ - (NSDictionary *)loadDefaults {
280
280
__block NSDictionary *state = nil ;
281
281
dispatch_sync (self.synchronizationQueue , ^{
282
282
#if CLS_TARGET_CAN_WRITE_TO_DISK
283
- BOOL isDirectory;
283
+ BOOL isDirectory = NO ;
284
284
BOOL fileExists = [[NSFileManager defaultManager ] fileExistsAtPath: [self ->_fileURL path ]
285
285
isDirectory: &isDirectory];
286
286
@@ -289,7 +289,7 @@ - (NSDictionary *)loadDefaults {
289
289
if (nil == state) {
290
290
FIRCLSErrorLog (@" Failed to read existing UserDefaults file" );
291
291
}
292
- } else if (!fileExists && !isDirectory ) {
292
+ } else if (!fileExists) {
293
293
// No file found. This is expected on first launch.
294
294
} else if (fileExists && isDirectory) {
295
295
FIRCLSErrorLog (@" Found directory where file expected. Removing conflicting directory" );
You can’t perform that action at this time.
0 commit comments