diff --git a/cdio-utils.spec b/cdio-utils.spec index b8fcbb3..e7bb307 100644 --- a/cdio-utils.spec +++ b/cdio-utils.spec @@ -1,7 +1,7 @@ # # spec file for package cdio-utils # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/fix-undefined-behavior-in-readlink.patch b/fix-undefined-behavior-in-readlink.patch new file mode 100644 index 0000000..424abfc --- /dev/null +++ b/fix-undefined-behavior-in-readlink.patch @@ -0,0 +1,28 @@ +diff --git a/test/driver/realpath.c b/test/driver/realpath.c +index 289253e4..4e85af96 100644 +--- a/test/driver/realpath.c ++++ b/test/driver/realpath.c +@@ -175,14 +175,16 @@ main(int argc, const char *argv[]) + rc = check_rc(symlink(psz_symlink_file, psz_symlink_file), + "symlink", psz_symlink_file); + if (0 == rc) { +- cdio_realpath(psz_symlink_file, psz_file_check); +- if (0 != strncmp(psz_file_check, symlink_file, PATH_MAX)) { +- fprintf(stderr, "direct cdio_realpath cycle test failed. %s vs %s\n", +- psz_file_check, symlink_file); +- rc = 5; +- goto err_exit; ++ char *retvalue = cdio_realpath(psz_symlink_file, psz_file_check); ++ if (0 != retvalue) { ++ if (0 != strncmp(psz_file_check, symlink_file, PATH_MAX)) { ++ fprintf(stderr, "direct cdio_realpath cycle test failed. %s vs %s\n", ++ psz_file_check, symlink_file); ++ rc = 5; ++ goto err_exit; ++ } ++ check_rc(unlink(psz_symlink_file), "unlink", psz_symlink_file); + } +- check_rc(unlink(psz_symlink_file), "unlink", psz_symlink_file); + } + + } diff --git a/libcdio.changes b/libcdio.changes index 108bb1b..4557e42 100644 --- a/libcdio.changes +++ b/libcdio.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 22 04:18:33 UTC 2022 - Martin Liška + +- Add fix-undefined-behavior-in-readlink.patch that fixes boo#1202214. + ------------------------------------------------------------------- Sat Oct 16 11:58:37 UTC 2021 - Bjørn Lie diff --git a/libcdio.spec b/libcdio.spec index 5a91753..8843460 100644 --- a/libcdio.spec +++ b/libcdio.spec @@ -1,7 +1,7 @@ # # spec file for package libcdio # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -32,6 +32,7 @@ Source0: https://ftp.gnu.org/gnu/libcdio/%{name}-%{version}.tar.bz2 Source1: https://ftp.gnu.org/gnu/libcdio/%{name}-%{version}.tar.bz2.sig Source2: %{name}.keyring Source3: baselibs.conf +Patch0: fix-undefined-behavior-in-readlink.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: help2man @@ -117,6 +118,7 @@ applications that want to make use of the cdio libraries. %prep %setup -q +%patch0 -p1 %build %configure \