Skip to content

Commit 2423288

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fixed possible usage of uninitialized value
2 parents b6000b7 + 886a34b commit 2423288

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
@@ -675,6 +675,9 @@ int odbc_bindcols(odbc_result *result)
675675
default:
676676
rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), colfieldid,
677677
NULL, 0, NULL, &displaysize);
678+
if (rc != SQL_SUCCESS) {
679+
displaysize = 0;
680+
}
678681
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
679682
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO && colfieldid == SQL_DESC_OCTET_LENGTH) {
680683
SQLINTEGER err;
@@ -694,6 +697,9 @@ int odbc_bindcols(odbc_result *result)
694697
charextraalloc = 1;
695698
rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_DISPLAY_SIZE,
696699
NULL, 0, NULL, &displaysize);
700+
if (rc != SQL_SUCCESS) {
701+
displaysize = 0;
702+
}
697703
}
698704

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

0 commit comments

Comments
 (0)