mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
MFH: Fix #47438 mysql_fetch_field ignores zero offse
This commit is contained in:
parent
42bb8ed2b5
commit
b489d3a69f
3 changed files with 41 additions and 1 deletions
|
@ -2318,7 +2318,7 @@ PHP_FUNCTION(mysql_fetch_field)
|
|||
|
||||
ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, &result, -1, "MySQL result", le_result);
|
||||
|
||||
if (field) {
|
||||
if (ZEND_NUM_ARGS() > 1) {
|
||||
if (field<0 || field>=(int)mysql_num_fields(mysql_result)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset");
|
||||
RETURN_FALSE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue