Update to upstream 1.0 release

Signed-off-by: Daiki Ueno <dueno@redhat.com>
This commit is contained in:
Daiki Ueno 2022-01-23 10:12:55 +01:00
parent 910caf86b2
commit d9494a370f
4 changed files with 9 additions and 91 deletions

1
.gitignore vendored
View File

@ -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

View File

@ -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

View File

@ -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 <dueno@redhat.com> - 1.0-1
- Update to upstream 1.0 release
- Switch to %%autosetup
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (libunistring-0.9.10.tar.xz) = 01dcab6e05ea4c33572bf96cc0558bcffbfc0e62fc86410cef06c1597a0073d5750525fe2dee4fdb39c9bd704557fcbab864f9645958108a2e07950bc539fe54
SHA512 (libunistring-1.0.tar.xz) = 70d5ad82722844dbeacdfcb4d7593358e4a00a9222a98537add4b7f0bf4a2bb503dfb3cd627e52e2a5ca1d3da9e5daf38a6bd521197f92002e11e715fb1662d1