Ver código fonte

Fixed potential dereference of NULL outErr argument in -startSavePointWithName:error: and -releaseSavePointWithName:error:.

Jim Correia 12 anos atrás
pai
commit
c199a6de6f
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      src/FMDatabase.m

+ 3 - 3
src/FMDatabase.m

@@ -1007,8 +1007,8 @@ - (BOOL)startSavePointWithName:(NSString*)name error:(NSError**)outErr {
     NSParameterAssert(name);
     
     if (![self executeUpdate:[NSString stringWithFormat:@"savepoint '%@';", name]]) {
-        
-        if (*outErr) {
+
+        if (outErr) {
             *outErr = [self lastError];
         }
         
@@ -1024,7 +1024,7 @@ - (BOOL)releaseSavePointWithName:(NSString*)name error:(NSError**)outErr {
     
     BOOL worked = [self executeUpdate:[NSString stringWithFormat:@"release savepoint '%@';", name]];
     
-    if (!worked && *outErr) {
+    if (!worked && outErr) {
         *outErr = [self lastError];
     }