From 1969955e50fd384f68535314cc162eecf33a89ae Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 1 Jan 2025 20:22:39 +0000 Subject: [PATCH] ext/pdo: Drop redundant mode check, and fix the first check (#17302) --- ext/pdo/pdo_stmt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index a39b7a3b06804..bc823d8c391cf 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1090,7 +1090,7 @@ static bool pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode mode = mode & ~PDO_FETCH_FLAGS; - if (mode < 0 || mode > PDO_FETCH__MAX) { + if (mode < 0 || mode >= PDO_FETCH__MAX) { zend_argument_value_error(mode_arg_num, "must be a bitmask of PDO::FETCH_* constants"); return 0; } @@ -1123,10 +1123,6 @@ static bool pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode zend_argument_value_error(mode_arg_num, "must use PDO::FETCH_CLASSTYPE with PDO::FETCH_CLASS"); return 0; } - if (mode >= PDO_FETCH__MAX) { - zend_argument_value_error(mode_arg_num, "must be a bitmask of PDO::FETCH_* constants"); - return 0; - } ZEND_FALLTHROUGH; case PDO_FETCH_CLASS: