bail out when detecting incorrect number of parameters to be bound.

This commit is contained in:
Andrey Hristov 2005-05-07 07:44:41 +00:00
parent 1ee0293680
commit b7df40a75a

View File

@ -109,12 +109,13 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
start = 1;
}
if (strlen(types) != argc - start) {
if (typelen != argc - start) {
/* number of bind variables doesn't match number of elements in type definition string */
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of elements in type definition string doesn't match number of bind variables");
RETURN_FALSE;
}
if (argc - start != stmt->stmt->param_count) {
if (typelen != stmt->stmt->param_count) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of variables doesn't match number of parameters in prepared statement");
RETURN_FALSE;
}