From aafa492e78819a0c9fdef37340707a4dc975ba4c Mon Sep 17 00:00:00 2001 From: fandehui Date: Thu, 28 Dec 2023 16:28:18 +0800 Subject: [PATCH] ctlib: Fix cs_will_convert Use CT-Library types, not TDS ones. Signed-off-by: fandehui (cherry picked from commit 493587811eb5784f24e747a926485adc796cb42a) --- ctlib-Fix-cs_will_convert.patch | 28 ++++++++++++++++++++++++++++ freetds.spec | 6 +++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 ctlib-Fix-cs_will_convert.patch diff --git a/ctlib-Fix-cs_will_convert.patch b/ctlib-Fix-cs_will_convert.patch new file mode 100644 index 0000000..19bcf17 --- /dev/null +++ b/ctlib-Fix-cs_will_convert.patch @@ -0,0 +1,28 @@ +From 84f3ff1d8f76ba6f764a6b2fa164c40aba54c28a Mon Sep 17 00:00:00 2001 +From: Frediano Ziglio +Date: Sun, 17 Mar 2019 19:02:35 +0000 +Subject: [PATCH] ctlib: Fix cs_will_convert + +Use CT-Library types, not TDS ones. + +Signed-off-by: Frediano Ziglio +--- + src/ctlib/cs.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/ctlib/cs.c b/src/ctlib/cs.c +index 30dd2de0..70c314c1 100644 +--- a/src/ctlib/cs.c ++++ b/src/ctlib/cs.c +@@ -1293,6 +1293,8 @@ cs_will_convert(CS_CONTEXT * ctx, CS_INT srctype, CS_INT desttype, CS_BOOL * res + + tdsdump_log(TDS_DBG_FUNC, "cs_will_convert(%p, %d, %d, %p)\n", ctx, srctype, desttype, result); + ++ srctype = _ct_get_server_type(NULL, srctype); ++ desttype = _ct_get_server_type(NULL, desttype); + *result = (tds_willconvert(srctype, desttype) ? CS_TRUE : CS_FALSE); + return CS_SUCCEED; + } +-- +2.27.0 + diff --git a/freetds.spec b/freetds.spec index ed86d45..b11f934 100644 --- a/freetds.spec +++ b/freetds.spec @@ -1,13 +1,14 @@ Name: freetds Summary: Implementation of the TDS (Tabular DataStream) protocol Version: 1.00.38 -Release: 8 +Release: 9 License: LGPLv2+ and GPLv2+ URL: http://www.freetds.org/ Source0: ftp://ftp.freetds.org/pub/freetds/stable/freetds-%{version}.tar.bz2 Source1: freetds-tds_sysdep_public.h Patch0: CVE-2019-13508.patch +Patch1: ctlib-Fix-cs_will_convert.patch BuildRequires: unixODBC-devel readline-devel gnutls-devel krb5-devel BuildRequires: libgcrypt-devel libtool doxygen docbook-style-dsssl @@ -120,6 +121,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Dec 28 2023 fandehui - 1.00.38-9 +- ctlib: Fix cs_will_convert + * Wed Feb 09 2022 wangkai - 1.00.38-8 - Fix CVE-2019-13508