From 0fcb48944eb18ea9d1738e5678865044289c67ed Mon Sep 17 00:00:00 2001 From: yinyongkang Date: Thu, 25 Jul 2024 09:47:24 +0800 Subject: [PATCH] fix CVE-2024-6197 --- backport-CVE-2024-6197.patch | 24 ++++++++++++++++++++++++ curl.spec | 9 ++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 backport-CVE-2024-6197.patch diff --git a/backport-CVE-2024-6197.patch b/backport-CVE-2024-6197.patch new file mode 100644 index 0000000..a888cef --- /dev/null +++ b/backport-CVE-2024-6197.patch @@ -0,0 +1,24 @@ +From 3a537a4db9e65e545ec45b1b5d5575ee09a2569d Mon Sep 17 00:00:00 2001 +From: z2_ <88509734+z2-2z@users.noreply.github.com> +Date: Fri, 28 Jun 2024 14:45:47 +0200 +Subject: [PATCH] x509asn1: remove superfluous free() + +--- + lib/vtls/x509asn1.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c +index c3fd3a3..897a1de 100644 +--- a/lib/vtls/x509asn1.c ++++ b/lib/vtls/x509asn1.c +@@ -391,7 +391,6 @@ utf8asn1str(char **to, int type, const char *from, const char *end) + if(wc >= 0x00000800) { + if(wc >= 0x00010000) { + if(wc >= 0x00200000) { +- free(buf); + return -1; /* Invalid char. size for target encoding. */ + } + buf[outlength + 3] = (char) (0x80 | (wc & 0x3F)); +-- +2.41.0 + diff --git a/curl.spec b/curl.spec index 7ba7293..eb50e6a 100644 --- a/curl.spec +++ b/curl.spec @@ -7,7 +7,7 @@ Name: curl Version: 8.4.0 -Release: 5 +Release: 6 Summary: Curl is used in command lines or scripts to transfer data License: curl URL: https://curl.se/ @@ -30,6 +30,7 @@ Patch21: backport-libssh2-set-length-to-0-if-strdup-failed.patch Patch22: backport-openldap-create-ldap-URLs-correctly-for-IPv6-addresses.patch Patch23: backport-multi-avoid-memory-leak-risk.patch Patch24: backport-tool_cfgable-free-proxy_-cipher13_list-on-exit.patch +Patch25: backport-CVE-2024-6197.patch BuildRequires: automake brotli-devel coreutils gcc groff krb5-devel BuildRequires: libidn2-devel libnghttp2-devel libpsl-devel @@ -215,6 +216,12 @@ rm -rf ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la %{_mandir}/man3/* %changelog +* Thu Jul 25 2024 yinyongkang - 8.4.0-6 +- Type:CVE +- CVE:CVE-2024-6197 +- SUG:NA +- DESC:fix CVE-2024-6197 + * Mon Jun 24 2024 zhouyihang - 8.4.0-5 - Type:bugfix - CVE:NA -- Gitee