From dbf29330a7ab4fd40c08cc6d1337a1323bf1c8f611b4876041ebaa325dece442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 3 Oct 2024 18:34:28 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main pam_pkcs11 revision c54a93399f5aa5198bb8da8e15292f57 --- 0001-memory-leak-fixes.patch | 29 +++++++++++++++++++++++++++++ pam_pkcs11.changes | 8 ++++++++ pam_pkcs11.spec | 5 ++++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 0001-memory-leak-fixes.patch diff --git a/0001-memory-leak-fixes.patch b/0001-memory-leak-fixes.patch new file mode 100644 index 0000000..32f0ca9 --- /dev/null +++ b/0001-memory-leak-fixes.patch @@ -0,0 +1,29 @@ +--- a/src/mappers/mapper.c ++++ b/src/mappers/mapper.c +@@ -83,7 +83,12 @@ + /* get a line from buffer */ + from = mfile->pt; + /* set up pointer */ +- while( *from && isspace(*from) ) from++; ++ while( *from && isspace(*from)){ ++ if(from - mfile->buffer + 1 >= mfile->length){ ++ return 0; ++ } ++ from++; ++ } + to = strchr(from,'\n'); + /* if no newline, assume string ends at end of buffer */ + if (!to) to=mfile->buffer+mfile->length; + +--- a/src/pam_pkcs11/pam_pkcs11.c ++++ b/src/pam_pkcs11/pam_pkcs11.c +@@ -208,7 +208,7 @@ + { + int i, rv; + const char *user = NULL; +- char *password; ++ char *password = NULL; + unsigned int slot_num = 0; + int is_a_screen_saver = 0; + struct configuration_st *configuration; + diff --git a/pam_pkcs11.changes b/pam_pkcs11.changes index 7f38153..28ca2dc 100644 --- a/pam_pkcs11.changes +++ b/pam_pkcs11.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Sep 24 21:07:33 UTC 2024 - Simon Vogl + +- Fix for boo#1230870: + * Add patch 0001-memory-leak-fixes.patch +- Add -Wno-implicit-function-declaration to CFLAGS to fix build + with gcc14 and newer + ------------------------------------------------------------------- Tue May 7 15:19:11 UTC 2024 - Davide Benini diff --git a/pam_pkcs11.spec b/pam_pkcs11.spec index 4e36911..483411e 100644 --- a/pam_pkcs11.spec +++ b/pam_pkcs11.spec @@ -1,7 +1,7 @@ # # spec file for package pam_pkcs11 # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -35,6 +35,8 @@ Patch0: %{name}-fsf-address.patch Patch1: %{name}-0.5.3-nss-conf.patch Patch3: %{name}-0.6.0-nss-autoconf.patch Patch4: 0001-Set-slot_num-configuration-parameter-to-0-by-default.patch +# 0001-memory-leak-fixes.patch - Fix memory leaks and issues with kscreenlocker (boo#1230870) - adapted from https://github.com/OpenSC/pam_pkcs11/commit/f8e7d85aa3ca4fd2e2a8c2dfe601d1224debe372.patch +Patch6: 0001-memory-leak-fixes.patch BuildRequires: curl-devel BuildRequires: docbook-xsl-stylesheets BuildRequires: doxygen @@ -97,6 +99,7 @@ sed -i '/^HTML_TIMESTAMP/s/YES/NO/' doc/doxygen.conf.in %build ./bootstrap %configure\ + CFLAGS="${CFLAGS:-%optflags} -Wno-implicit-function-declaration"\ --docdir=%{_docdir}/%{name}\ --with-nss\ --with-curl