mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed bug #25081 (odbc_fetch_array() may mangle numeric fields).
This commit is contained in:
parent
970371efa2
commit
e6b916cb15
1 changed files with 6 additions and 1 deletions
|
@ -1457,8 +1457,13 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
|
||||||
if (result_type & ODBC_NUM) {
|
if (result_type & ODBC_NUM) {
|
||||||
zend_hash_index_update(Z_ARRVAL_P(return_value), i, &tmp, sizeof(pval *), NULL);
|
zend_hash_index_update(Z_ARRVAL_P(return_value), i, &tmp, sizeof(pval *), NULL);
|
||||||
} else {
|
} else {
|
||||||
zend_hash_update(Z_ARRVAL_P(return_value), result->values[i].name,
|
if (!*(result->values[i].name)) {
|
||||||
|
zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_P(tmp),
|
||||||
|
Z_STRLEN_P(tmp)+1, &tmp, sizeof(pval *), NULL);
|
||||||
|
} else {
|
||||||
|
zend_hash_update(Z_ARRVAL_P(return_value), result->values[i].name,
|
||||||
strlen(result->values[i].name)+1, &tmp, sizeof(pval *), NULL);
|
strlen(result->values[i].name)+1, &tmp, sizeof(pval *), NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (buf) efree(buf);
|
if (buf) efree(buf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue