Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Robert Scheck
98ae9c2167 Import libunistring-0.9.3-5.el6.src.rpm 2017-02-03 14:38:14 +01:00
5 changed files with 133 additions and 21 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/libunistring-0.9.3.tar.gz

View file

@ -0,0 +1,45 @@
From 157da9e2421d3db15b9fa2f832d650b64818accc Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Wed, 29 Feb 2012 08:05:09 -0500
Subject: [PATCH] Add NULL check for malloc() in two uninorm files
---
lib/uninorm/u-normalize-internal.h | 5 +++++
lib/uninorm/uninorm-filter.c | 5 +++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/lib/uninorm/u-normalize-internal.h b/lib/uninorm/u-normalize-internal.h
index e21243fe5589c0ca87ce230f5ea049bb37224a07..955893c15fa9044f9eff2ea407504008d9e35eea 100644
--- a/lib/uninorm/u-normalize-internal.h
+++ b/lib/uninorm/u-normalize-internal.h
@@ -310,6 +310,11 @@ FUNC (uninorm_t nf, const UNIT *s, size_t n,
abort ();
new_sortbuf =
(struct ucs4_with_ccc *) malloc (2 * sortbuf_allocated * sizeof (struct ucs4_with_ccc));
+ if(new_sortbuf == NULL) {
+ errno = ENOMEM;
+ goto fail;
+ }
+
memcpy (new_sortbuf, sortbuf,
sortbuf_count * sizeof (struct ucs4_with_ccc));
if (sortbuf != sortbuf_preallocated)
diff --git a/lib/uninorm/uninorm-filter.c b/lib/uninorm/uninorm-filter.c
index 3d991cbf027b1cd4e589838d00865a5ff94905b9..2df1490281ada05bac1f0cf01ce3ef8883ea9920 100644
--- a/lib/uninorm/uninorm-filter.c
+++ b/lib/uninorm/uninorm-filter.c
@@ -241,6 +241,11 @@ uninorm_filter_write (struct uninorm_filter *filter, ucs4_t uc_arg)
new_sortbuf =
(struct ucs4_with_ccc *)
malloc (2 * filter->sortbuf_allocated * sizeof (struct ucs4_with_ccc));
+ if (new_sortbuf == NULL) {
+ errno = ENOMEM;
+ return -1;
+ }
+
memcpy (new_sortbuf, filter->sortbuf,
sortbuf_count * sizeof (struct ucs4_with_ccc));
if (filter->sortbuf != filter->sortbuf_preallocated)
--
1.7.7.6

View file

@ -1,21 +0,0 @@
# Makefile for source rpm: libunistring
# $Id$
NAME := libunistring
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

86
libunistring.spec Normal file
View file

@ -0,0 +1,86 @@
Name: libunistring
Version: 0.9.3
Release: 5%{?dist}
Group: System Environment/Libraries
Summary: GNU Unicode string library
License: LGPLv3+
Url: http://www.gnu.org/software/libunistring/
Source0: http://ftp.gnu.org/gnu/libunistring/%{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires(post): info
Requires(preun): info
# Patches
Patch0001: 0001-Add-NULL-check-for-malloc-in-two-uninorm-files.patch
%description
This portable C library implements Unicode string types in three flavours:
(UTF-8, UTF-16, UTF-32), together with functions for character processing
(names, classifications, properties) and functions for string processing
(iteration, formatted output, width, word breaks, line breaks, normalization,
case folding and regular expressions).
%package devel
Group: Development/Libraries
Summary: GNU Unicode string library - development files
Requires: %{name} = %{version}-%{release}
%description devel
Development files for programs using libunistring.
%prep
%setup -q
%patch0001 -p1
%build
%configure --disable-static --disable-rpath
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}.la
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc AUTHORS NEWS README
%{_libdir}/%{name}.so.*
%files devel
%defattr(-,root,root,-)
%doc HACKING DEPENDENCIES THANKS ChangeLog
%doc %{_datadir}/doc/%{name}/*.html
%{_infodir}/%{name}.info*
%{_libdir}/%{name}.so
%{_includedir}/unistring
%{_includedir}/*.h
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post devel
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
%preun devel
if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
fi
%changelog
* Wed Feb 29 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5
- Resolves: rhbz#732017 - Malloc without NULL check
* Mon Sep 12 2011 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4
- Resolves: rhbz#737592 - %%preun error while uninstalling libunistring-devel
* Tue Aug 02 2011 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3
- Imported from Fedora
- Resolves: rhbz#726463 - Add libunistring as a separate component/package
into RHEL

View file

@ -0,0 +1 @@
SHA512 (libunistring-0.9.3.tar.gz) = 351c0c94c4a31efbed932978ff8afae4defd7c28771d2d877b5ead5383a4f1b53200ece72b6908a9bafb7836775b2af3465e051226e43520ada2b8c583314d12