Fixed bug #25081 (odbc_fetch_array() may mangle numeric fields).

This commit is contained in:
Ilia Alshanetsky 2003-08-14 14:36:38 +00:00
parent 970371efa2
commit e6b916cb15

View file

@ -1456,11 +1456,16 @@ 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 {
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);
}
/* }}} */