]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #25081 (odbc_fetch_array() may mangle numeric fields).
authorIlia Alshanetsky <iliaa@php.net>
Thu, 14 Aug 2003 14:37:33 +0000 (14:37 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 14 Aug 2003 14:37:33 +0000 (14:37 +0000)
NEWS
ext/odbc/php_odbc.c

diff --git a/NEWS b/NEWS
index 7fb9112983f98c91b98ea7542f76026ca81415bf..b7fab7a5fe073c6cf172fbe3f411335447b0a9a5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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)
index b8c5a031e6120269a9caf326bced76cc00d1f91c..49d40e55e2e78c661a8af2c68dc5e08f3a6184e0 100644 (file)
@@ -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);