From d9494a370fd9700ba1e8d9a8019b6aac53a0bc18 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Sun, 23 Jan 2022 10:12:55 +0100 Subject: [PATCH] Update to upstream 1.0 release Signed-off-by: Daiki Ueno --- .gitignore | 1 + fix-memory-leak-in-vasnprintf.patch | 85 ----------------------------- libunistring.spec | 12 ++-- sources | 2 +- 4 files changed, 9 insertions(+), 91 deletions(-) delete mode 100644 fix-memory-leak-in-vasnprintf.patch diff --git a/.gitignore b/.gitignore index 0fc702c..5ae8508 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ libunistring-0.9.3.tar.gz /libunistring-0.9.8.tar.xz /libunistring-0.9.9.tar.xz /libunistring-0.9.10.tar.xz +/libunistring-1.0.tar.xz diff --git a/fix-memory-leak-in-vasnprintf.patch b/fix-memory-leak-in-vasnprintf.patch deleted file mode 100644 index 66649ba..0000000 --- a/fix-memory-leak-in-vasnprintf.patch +++ /dev/null @@ -1,85 +0,0 @@ -diff -ru libunistring-0.9.10/lib/vasnprintf.c libunistring-0.9.10.new/lib/vasnprintf.c ---- libunistring-0.9.10/lib/vasnprintf.c 2018-05-25 18:02:16.000000000 +0200 -+++ libunistring-0.9.10.new/lib/vasnprintf.c 2021-06-14 17:06:43.084948649 +0200 -@@ -1864,7 +1864,7 @@ - - /* Ensures that allocated >= needed. Aborts through a jump to - out_of_memory if needed is SIZE_MAX or otherwise too big. */ --#define ENSURE_ALLOCATION(needed) \ -+#define ENSURE_ALLOCATION_ELSE(needed, oom_statement) \ - if ((needed) > allocated) \ - { \ - size_t memory_size; \ -@@ -1875,17 +1875,19 @@ - allocated = (needed); \ - memory_size = xtimes (allocated, sizeof (DCHAR_T)); \ - if (size_overflow_p (memory_size)) \ -- goto out_of_memory; \ -+ oom_statement \ - if (result == resultbuf || result == NULL) \ - memory = (DCHAR_T *) malloc (memory_size); \ - else \ - memory = (DCHAR_T *) realloc (result, memory_size); \ - if (memory == NULL) \ -- goto out_of_memory; \ -+ oom_statement \ - if (result == resultbuf && length > 0) \ - DCHAR_CPY (memory, result, length); \ - result = memory; \ - } -+#define ENSURE_ALLOCATION(needed) \ -+ ENSURE_ALLOCATION_ELSE((needed), goto out_of_memory; ) - - for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) - { -@@ -2137,7 +2139,8 @@ - } - if (converted != result + length) - { -- ENSURE_ALLOCATION (xsum (length, converted_len)); -+ ENSURE_ALLOCATION_ELSE (xsum (length, converted_len), -+ { free (converted); goto out_of_memory; }); - DCHAR_CPY (result + length, converted, converted_len); - free (converted); - } -@@ -2263,7 +2266,8 @@ - } - if (converted != result + length) - { -- ENSURE_ALLOCATION (xsum (length, converted_len)); -+ ENSURE_ALLOCATION_ELSE (xsum (length, converted_len), -+ { free (converted); goto out_of_memory; }); - DCHAR_CPY (result + length, converted, converted_len); - free (converted); - } -@@ -2389,7 +2393,8 @@ - } - if (converted != result + length) - { -- ENSURE_ALLOCATION (xsum (length, converted_len)); -+ ENSURE_ALLOCATION_ELSE (xsum (length, converted_len), -+ { free (converted); goto out_of_memory; }); - DCHAR_CPY (result + length, converted, converted_len); - free (converted); - } -@@ -2914,7 +2919,8 @@ - } - } - # else -- ENSURE_ALLOCATION (xsum (length, tmpdst_len)); -+ ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len), -+ { free (tmpdst); goto out_of_memory; }); - DCHAR_CPY (result + length, tmpdst, tmpdst_len); - free (tmpdst); - length += tmpdst_len; -@@ -5368,7 +5374,8 @@ - errno = saved_errno; - return NULL; - } -- ENSURE_ALLOCATION (xsum (length, tmpdst_len)); -+ ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len), -+ { free (tmpdst); goto out_of_memory; }); - DCHAR_CPY (result + length, tmpdst, tmpdst_len); - free (tmpdst); - count = tmpdst_len; -libunistring-0.9.10.new/lib のみに存在: vasnprintf.c.orig diff --git a/libunistring.spec b/libunistring.spec index 4227672..6fd44b1 100644 --- a/libunistring.spec +++ b/libunistring.spec @@ -1,12 +1,11 @@ # This spec file has been automatically updated -Version: 0.9.10 -Release: 15%{?dist} +Version: 1.0 +Release: 1%{?dist} Name: libunistring Summary: GNU Unicode string library License: GPLv2+ or LGPLv3+ URL: https://www.gnu.org/software/libunistring/ Source0: https://ftp.gnu.org/gnu/libunistring/%{name}-%{version}.tar.xz -Patch0: fix-memory-leak-in-vasnprintf.patch BuildRequires: gcc BuildRequires: make Provides: bundled(gnulib) @@ -26,8 +25,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Development files for programs using libunistring. %prep -%setup -q -%patch0 -p1 -b .fix-memory-leak-in-vasnprintf +%autosetup %build %configure --disable-static --disable-rpath @@ -56,6 +54,10 @@ mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name} __doc %ldconfig_scriptlets %changelog +* Sun Jan 23 2022 Daiki Ueno - 1.0-1 +- Update to upstream 1.0 release +- Switch to %%autosetup + * Thu Jan 20 2022 Fedora Release Engineering - 0.9.10-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/sources b/sources index fdd5713..ed526b9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libunistring-0.9.10.tar.xz) = 01dcab6e05ea4c33572bf96cc0558bcffbfc0e62fc86410cef06c1597a0073d5750525fe2dee4fdb39c9bd704557fcbab864f9645958108a2e07950bc539fe54 +SHA512 (libunistring-1.0.tar.xz) = 70d5ad82722844dbeacdfcb4d7593358e4a00a9222a98537add4b7f0bf4a2bb503dfb3cd627e52e2a5ca1d3da9e5daf38a6bd521197f92002e11e715fb1662d1