Skip to content

Commit 886a34b

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fixed possible usage of uninitialized value
2 parents 9fad9ad + 1f521a0 commit 886a34b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/odbc/php_odbc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,9 @@ int odbc_bindcols(odbc_result *result)
993993
default:
994994
rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), colfieldid,
995995
NULL, 0, NULL, &displaysize);
996+
if (rc != SQL_SUCCESS) {
997+
displaysize = 0;
998+
}
996999
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
9971000
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO && colfieldid == SQL_DESC_OCTET_LENGTH) {
9981001
SQLINTEGER err;
@@ -1012,6 +1015,9 @@ int odbc_bindcols(odbc_result *result)
10121015
charextraalloc = 1;
10131016
rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_DISPLAY_SIZE,
10141017
NULL, 0, NULL, &displaysize);
1018+
if (rc != SQL_SUCCESS) {
1019+
displaysize = 0;
1020+
}
10151021
}
10161022

10171023
/* Workaround for drivers that report NVARCHAR(MAX) columns as SQL_WVARCHAR with size 0 (bug #69975) */

0 commit comments

Comments
 (0)