diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-08-14 14:37:33 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-08-14 14:37:33 +0000 |
commit | 33d7423950cb69ed7e75e9a26e42262dba383824 (patch) | |
tree | 8182a9fa0c69b0ebe5ab14c92d2465a3c793d082 | |
parent | 30c26df3489fe71b02f29ca310567ca2b0831204 (diff) | |
download | php-git-33d7423950cb69ed7e75e9a26e42262dba383824.tar.gz |
MFH: Fixed bug #25081 (odbc_fetch_array() may mangle numeric fields).
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | ext/odbc/php_odbc.c | 7 |
2 files changed, 7 insertions, 1 deletions
@@ -2,6 +2,7 @@ PHP 4 NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Aug 2003, Version 4.3.3RC4 - Fixed bug #25084 (Make refer check not dependant on register_globals). (Ilia) +- Fixed bug #25081 (odbc_fetch_array() may mangle numeric fields). (Ilia) - Fixed bug #25044 (header("Location:") changing HTTP status). (Marcus) - Fixed bug #25037 (Possible infinite loop inside SendText()). (Ilia) - Fixed bug #25007 (rand() & mt_rand() seed RNG every call). (Jani) diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index b8c5a031e6..49d40e55e2 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1459,8 +1459,13 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) if (result_type & ODBC_NUM) { zend_hash_index_update(Z_ARRVAL_P(return_value), i, &tmp, sizeof(pval *), NULL); } 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); + } } } if (buf) efree(buf); |