summaryrefslogtreecommitdiff
path: root/ext/pdo_odbc
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-06-24 12:03:13 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-06-24 12:07:58 +0200
commit38177dcb421cafef18fd903c6ae170ddc40ae599 (patch)
tree6707eba25ef00f1bb854c571138670701911e689 /ext/pdo_odbc
parent16fe64d3edfb0e834d5faa3fec4624b62ea77ae8 (diff)
downloadphp-git-38177dcb421cafef18fd903c6ae170ddc40ae599.tar.gz
Properly initialize displaysize
From Microsoft's `SQLColAttribute()` documentation[1]: | 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>
Diffstat (limited to 'ext/pdo_odbc')
-rw-r--r--ext/pdo_odbc/odbc_stmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c
index 610c6121c5..6fd14a6f68 100644
--- a/ext/pdo_odbc/odbc_stmt.c
+++ b/ext/pdo_odbc/odbc_stmt.c
@@ -565,7 +565,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno)
RETCODE rc;
SWORD colnamelen;
SQLULEN colsize;
- SQLLEN displaysize;
+ SQLLEN displaysize = 0;
rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname,
sizeof(S->cols[colno].colname)-1, &colnamelen,