From: Christoph M. Becker Date: Wed, 24 Jun 2020 10:03:13 +0000 (+0200) Subject: Properly initialize displaysize X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38177dcb421cafef18fd903c6ae170ddc40ae599;p=php 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] --- 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,