summaryrefslogtreecommitdiff
path: root/ext/odbc
diff options
context:
space:
mode:
Diffstat (limited to 'ext/odbc')
-rw-r--r--ext/odbc/php_odbc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index adb7272d42..1e7166a5ec 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -1765,7 +1765,7 @@ 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(zval *), NULL);
} else {
- if (!*(result->values[i].name)) {
+ if (!*(result->values[i].name) && Z_TYPE_P(tmp) == IS_STRING) {
zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_P(tmp), Z_STRLEN_P(tmp)+1, &tmp, sizeof(zval *), NULL);
} else {
zend_hash_update(Z_ARRVAL_P(return_value), result->values[i].name, strlen(result->values[i].name)+1, &tmp, sizeof(zval *), NULL);