From: Dmitry Stogov Date: Wed, 27 May 2020 08:25:18 +0000 (+0300) Subject: Fixed possible usage of uninitialized value X-Git-Tag: php-7.3.20RC1~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f521a0b2397dc4b4f5607add1a67f8bc88df291;p=php Fixed possible usage of uninitialized value --- diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index e2a16a09a7..4ba9aa2d74 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -993,6 +993,9 @@ int odbc_bindcols(odbc_result *result) default: rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), colfieldid, NULL, 0, NULL, &displaysize); + if (rc != SQL_SUCCESS) { + displaysize = 0; + } #if defined(ODBCVER) && (ODBCVER >= 0x0300) if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO && colfieldid == SQL_DESC_OCTET_LENGTH) { SQLINTEGER err; @@ -1012,6 +1015,9 @@ int odbc_bindcols(odbc_result *result) charextraalloc = 1; rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_DISPLAY_SIZE, NULL, 0, NULL, &displaysize); + if (rc != SQL_SUCCESS) { + displaysize = 0; + } } /* Workaround for drivers that report NVARCHAR(MAX) columns as SQL_WVARCHAR with size 0 (bug #69975) */