We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8cf053a + 155d36c commit 8f50036Copy full SHA for 8f50036
ibm_db2.c
@@ -1971,7 +1971,13 @@ static int _php_db2_get_result_set_info(stmt_handle *stmt_res)
1971
return -1;
1972
}
1973
} else {
1974
- stmt_res->column_info[i].name = (SQLCHAR *)estrdup(tmp_name);
+ /*
1975
+ * CB20241114: In some cases on i (i.e. QP2SHELL w/ CCSID 65535),
1976
+ * SQL/CLI might not add a null terminator, and garbage can appear
1977
+ * at the end of column names. However, name_length is still
1978
+ * correct, so we truncate with that when copying the name.
1979
+ */
1980
+ stmt_res->column_info[i].name = (SQLCHAR *)estrndup(tmp_name, name_length);
1981
1982
switch (stmt_res->column_info[i].type) {
1983
/* BIGINT 9223372036854775807 (2^63-1) string convert */
0 commit comments