From 00546bc9b7cb8208c27de9c6ebd12156401a5607 Mon Sep 17 00:00:00 2001 From: Keyur Govande Date: Mon, 28 Jul 2014 23:15:23 +0000 Subject: Fix bug #60616 (odbc_fetch_into returns junk at end of multi-byte char fields) The ODBC extension did not support WVARCHAR. WVARCHAR ends up being handled by the default handler where vallen is set by the driver to the actual bytes needed for the field. If it is larger than default-lrl then the output is corrupted (reading past the buffer) because the return functions don't expect that to happen. The patch add support to handle WVARCHAR just like a regular VARCHAR. --- ext/odbc/php_odbc_includes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/odbc/php_odbc_includes.h') diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h index a9b0acfa0c..b3ae889974 100644 --- a/ext/odbc/php_odbc_includes.h +++ b/ext/odbc/php_odbc_includes.h @@ -284,7 +284,7 @@ int odbc_bindcols(odbc_result *result TSRMLS_DC); void odbc_sql_error(ODBC_SQL_ERROR_PARAMS); -#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR) +#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR || x == SQL_WVARCHAR || x == SQL_WLONGVARCHAR) #define IS_SQL_BINARY(x) (x == SQL_BINARY || x == SQL_VARBINARY || x == SQL_LONGVARBINARY) #ifdef ZTS -- cgit v1.2.1