diff --git a/01-fix-credman-leak.patch b/01-fix-credman-leak.patch new file mode 100644 index 0000000..31b9010 --- /dev/null +++ b/01-fix-credman-leak.patch @@ -0,0 +1,35 @@ +diff --git a/tools/credman.c b/tools/credman.c +index a0a3149d..9f6072f7 100644 +--- a/tools/credman.c ++++ b/tools/credman.c +@@ -119,6 +119,7 @@ print_rk(const fido_credman_rk_t *rk, size_t idx) + char *user_id = NULL; + const char *type; + const char *prot; ++ int r = -1; + + if ((cred = fido_credman_rk(rk, idx)) == NULL) { + warnx("fido_credman_rk"); +@@ -128,7 +129,7 @@ print_rk(const fido_credman_rk_t *rk, size_t idx) + &id) < 0 || base64_encode(fido_cred_user_id_ptr(cred), + fido_cred_user_id_len(cred), &user_id) < 0) { + warnx("output error"); +- return -1; ++ goto out; + } + + type = cose_string(fido_cred_type(cred)); +@@ -137,10 +138,12 @@ print_rk(const fido_credman_rk_t *rk, size_t idx) + printf("%02u: %s %s %s %s %s\n", (unsigned)idx, id, + fido_cred_display_name(cred), user_id, type, prot); + ++ r = 0; ++out: + free(user_id); + free(id); + +- return 0; ++ return r; + } + + int diff --git a/libfido2.spec b/libfido2.spec index da85244..550ef9d 100644 --- a/libfido2.spec +++ b/libfido2.spec @@ -1,7 +1,7 @@ Name: libfido2 Version: 1.14.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: FIDO2 library License: BSD-2-Clause @@ -10,6 +10,8 @@ Source0: https://developers.yubico.com/%{name}/Releases/%{name}-%{version Source1: https://developers.yubico.com/%{name}/Releases/%{name}-%{version}.tar.gz.sig Source2: yubico-release-gpgkeys.asc +Patch01: 01-fix-credman-leak.patch + BuildRequires: gnupg2 BuildRequires: cmake BuildRequires: make @@ -97,6 +99,10 @@ find %{buildroot} -type f -name "*.a" -delete -print %changelog +* Wed Oct 23 2024 Dmitry Belyavskiy - 1.14.0-6 +- Fix memory leak in credman + Resolves: RHEL-35253 + * Mon Jun 24 2024 Troy Dawson - 1.14.0-5 - Bump release for June 2024 mass rebuild