From ec5fbc25d93ffe2c5357d80673876f0f7b4c7df1 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Mon, 24 Aug 2026 13:02:56 -0400 Subject: [PATCH] [PDO] Return false from rewrite_name_to_position() on IM001 error path rewrite_name_to_position() returns bool, so the previous -1 was converted to true and the caller's failure check never triggered after raising the IM001 error for a repeated named parameter, leaving bindParam()/bindColumn() reporting success. Sibling audit: no other -1 return remains in this function; the other error paths already return 0. --- ext/pdo/pdo_stmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 4e41ea40f08b..22b9b16068a6 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -76,7 +76,7 @@ static inline bool rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_p if (param->paramno >= 0) { /* TODO Error? */ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "PDO refuses to handle repeating the same :named parameter for multiple positions with this driver, as it might be unsafe to do so. Consider using a separate name for each parameter instead"); - return -1; + return false; } param->paramno = position; return 1;