mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Properly initialize out parameter
The MS docs on `SQLColAttribute()`[1] state regarding the `NumericAttributePtr` parameter: | Please note that some drivers may only write the lower 32-bit or | 16-bit of a buffer and leave the higher-order bit unchanged. | Therefore, applications should initialize the value to 0 before | calling this function. [1] <https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcolattribute-function?view=sql-server-2017>
This commit is contained in:
parent
c79d5b86e0
commit
71e9013bab
@ -956,6 +956,7 @@ int odbc_bindcols(odbc_result *result)
|
||||
|
||||
rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), PHP_ODBC_SQL_DESC_NAME,
|
||||
result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0);
|
||||
result->values[i].coltype = 0;
|
||||
rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE,
|
||||
NULL, 0, NULL, &result->values[i].coltype);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user