From 6b75e04f2c370568c682d44ed5d3e4009e589cd3d2879c07691b27220749b8e0 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Wed, 24 Aug 2022 07:52:09 +0000 Subject: [PATCH] Accepting request 998531 from home:marxin:branches:multimedia:libs - Add fix-undefined-behavior-in-readlink.patch that fixes boo#1202214. OBS-URL: https://build.opensuse.org/request/show/998531 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/libcdio?expand=0&rev=65 --- cdio-utils.spec | 2 +- fix-undefined-behavior-in-readlink.patch | 28 ++++++++++++++++++++++++ libcdio.changes | 5 +++++ libcdio.spec | 4 +++- 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 fix-undefined-behavior-in-readlink.patch 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 \