Browse Source

bugfix, -[FMDatabase executeStatements:withResultBlock:] method has potential crash bugs, for setting nil object as NSMutableDictionary value

jam.chenjun 7 years ago
parent
commit
4b03d3f0ed
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/fmdb/FMDatabase.m

+ 1 - 0
src/fmdb/FMDatabase.m

@@ -1261,6 +1261,7 @@ int FMDBExecuteBulkSQLCallback(void *theBlockAsVoid, int columns, char **values,
     for (NSInteger i = 0; i < columns; i++) {
         NSString *key = [NSString stringWithUTF8String:names[i]];
         id value = values[i] ? [NSString stringWithUTF8String:values[i]] : [NSNull null];
+        value = value ? value : [NSNull null];
         [dictionary setObject:value forKey:key];
     }