]> granicus.if.org Git - php/commitdiff
Fix logic error in PDO
authorGeorge Peter Banyard <girgias@php.net>
Fri, 25 Sep 2020 13:54:25 +0000 (14:54 +0100)
committerGeorge Peter Banyard <girgias@php.net>
Fri, 25 Sep 2020 15:28:48 +0000 (16:28 +0100)
ext/pdo/pdo_stmt.c

index f010d0453b035d35ed40770a23c4e3b7cfe6c6e5..a322cd57610f2870c663f28a1976b55e9979bd50 100644 (file)
@@ -1873,7 +1873,8 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
                        mode = Z_LVAL(args[skip]);
                        flags = mode & PDO_FETCH_FLAGS;
 
-                       retval = pdo_stmt_verify_mode(stmt, mode, 0);
+                       /* pdo_stmt_verify_mode() returns a boolean value */
+                       retval = pdo_stmt_verify_mode(stmt, mode, 0) ? SUCCESS : FAILURE;
                }
        }