Skip to content

Commit

Permalink
ext/pdo: Drop redundant mode check, and fix the first check (#17302)
Browse files Browse the repository at this point in the history
  • Loading branch information
Girgias authored Jan 1, 2025
1 parent dfdba3c commit 1969955
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ext/pdo/pdo_stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 1969955

Please sign in to comment.