Accepting request 800053 from graphics

- added patches
  fix bsc#1170831 -- sent to bryanh@giraffe-data.com on 2020-05-04
  + netpbm-pbmtonokia-cmdline-txt-null.patch

- Add ubsan_build and remove not needed patch netpbm-asan.patch.

OBS-URL: https://build.opensuse.org/request/show/800053
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/netpbm?expand=0&rev=72
This commit is contained in:
Dominique Leuenberger 2020-05-07 15:49:28 +00:00 committed by Git OBS Bridge
commit 3501973eb0
4 changed files with 43 additions and 87 deletions

View File

@ -1,83 +0,0 @@
Index: netpbm-10.86.3/GNUmakefile
===================================================================
--- netpbm-10.86.3.orig/GNUmakefile 2019-05-14 09:16:35.984991072 +0200
+++ netpbm-10.86.3/GNUmakefile 2019-05-16 09:42:17.843531751 +0200
@@ -378,7 +378,7 @@ endif
netpbm:%:%.o $(OBJECT_DEP) $(NETPBMLIB) $(URTLIBDEP) $(LIBOPT)
# Note that LDFLAGS might contain -L options, so order is important.
$(LD) -o $@ $< $(OBJECT_LIST) \
- $(LDFLAGS) $(shell $(LIBOPT) $(NETPBMLIB) $(MERGELIBS)) \
+ $(LDFLAGS) -lasan $(shell $(LIBOPT) $(NETPBMLIB) $(MERGELIBS)) \
$(PNGLD) $(XML2LD) $(X11LD) $(MATHLIB) $(NETWORKLD) $(LADD)
netpbm.o: mergetrylist
Index: netpbm-10.86.3/buildtools/Makefile
===================================================================
--- netpbm-10.86.3.orig/buildtools/Makefile 2019-05-14 09:16:32.160972760 +0200
+++ netpbm-10.86.3/buildtools/Makefile 2019-05-16 09:42:13.255509230 +0200
@@ -41,10 +41,10 @@ genfontc.o:%.o:%.c importinc
$(NETPBM_INCLUDES) \
$<
genfontc:%:%.o $(NETPBMLIB)
- $(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $< $(NETPBMLIB)
+ $(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $< $(NETPBMLIB) -lasan
$(BUILDPROGS):%:%.o
- $(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $<
+ $(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $< -lasan
distclean clean: cleanlocal
.PHONY: cleanlocal
Index: netpbm-10.86.3/common.mk
===================================================================
--- netpbm-10.86.3.orig/common.mk 2019-05-14 09:16:32.156972741 +0200
+++ netpbm-10.86.3/common.mk 2019-05-16 09:42:26.703575262 +0200
@@ -386,7 +386,7 @@ LDFLAGS_ALL = $(WINICON_OBJECT) \
$(PORTBINARIES) $(MATHBINARIES): %: %.o \
$(NETPBMLIB) $(LIBOPT) $(WINICON_OBJECT)
- $(LD) -o $@$(EXE) $@.o $(ADDL_OBJECTS) $(LDFLAGS_ALL)
+ $(LD) -o $@$(EXE) $@.o $(ADDL_OBJECTS) -lasan $(LDFLAGS_ALL)
# MERGE STUFF
Index: netpbm-10.86.3/lib/Makefile
===================================================================
--- netpbm-10.86.3.orig/lib/Makefile 2019-05-14 09:16:32.832975977 +0200
+++ netpbm-10.86.3/lib/Makefile 2019-05-16 09:42:22.159552950 +0200
@@ -115,7 +115,7 @@ $(SONAME): \
-lc \
-soname libnetpbm.$(NETPBMLIBSUFFIX) \
-set_version $(shell perl -e '$(PERLPROG)') \
- $(LADD)
+ -lasan $(LADD)
endif
ifeq ($(NETPBMLIBTYPE),unixshared)
@@ -131,7 +131,7 @@ $(SONAME): libnetpbm.$(NETPBMLIBSUFFIX).
$(SYMLINK) $< $@
libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN): $(LIBOBJECTS) $(LIBOBJECTS_X)
$(LD) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
- $(SHLIB_CLIB) -lm $(LADD)
+ $(SHLIB_CLIB) -lm -lasan $(LADD)
endif
ifeq ($(NETPBMLIBTYPE),dll)
@@ -144,7 +144,7 @@ endif
-Wl,-soname,$(NETPBMSHLIBPREFIX)netpbm$(DLLVER).dll \
-Wl,--output-def,$(NETPBMSHLIBPREFIX)netpbm$(DLLVER).def \
-Wl,--out-implib,libnetpbm.dll.a -o $@ $(LDFLAGS) \
- $(LIBOBJECTS) $(LIBOBJECTS_X) $(LDLIBS) $(LADD)
+ $(LIBOBJECTS) $(LIBOBJECTS_X) $(LDLIBS) -lasan $(LADD)
endif
ifeq ($(NETPBMLIBTYPE),dylib)
@@ -158,7 +158,7 @@ libnetpbm.$(MAJ).dylib: libnetpbm.$(MAJ)
libnetpbm.$(MAJ).$(MIN).dylib: $(LIBOBJECTS) $(LIBOBJECTS_X)
$(LD) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
- -lc $(LADD)
+ -lc -lasan $(LADD)
endif
#--------------------------------------------------------------------------

View File

@ -0,0 +1,14 @@
Index: netpbm-10.88.1/converter/pbm/pbmtonokia.c
===================================================================
--- netpbm-10.88.1.orig/converter/pbm/pbmtonokia.c 2019-12-20 11:44:12.938955573 +0100
+++ netpbm-10.88.1/converter/pbm/pbmtonokia.c 2020-05-04 14:28:15.636966434 +0200
@@ -412,7 +412,8 @@ convertToNpm(bit ** const image,
header[ 3] = 0;
header[ 4] = len;
header[ 5] = 0;
- memcpy(&header[5], text, len);
+ if (text)
+ memcpy(&header[5], text, len);
header[ 6 + len] = cols;
header[ 7 + len] = rows;
header[ 8 + len] = 1;

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Mon May 4 12:42:15 UTC 2020 - pgajdos@suse.com
- added patches
fix bsc#1170831 -- sent to bryanh@giraffe-data.com on 2020-05-04
+ netpbm-pbmtonokia-cmdline-txt-null.patch
-------------------------------------------------------------------
Thu Apr 30 14:14:22 UTC 2020 - Martin Liška <mliska@suse.cz>
- Add ubsan_build and remove not needed patch netpbm-asan.patch.
-------------------------------------------------------------------
Fri Dec 20 12:48:25 UTC 2019 - pgajdos@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package netpbm
#
# Copyright (c) 2019 SUSE LLC
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -18,6 +18,7 @@
%define debug_build 0
%define asan_build 0
%define ubsan_build 0
%define libmaj 11
%define libmin 88
%define libver %{libmaj}.%{libmin}
@ -35,7 +36,6 @@ Source3: prepare-src-tarball.sh
# SUSE specific
Patch0: %{name}-make.patch
# neccessary for running with ASAN
Patch1: %{name}-asan.patch
Patch3: %{name}-tmpfile.patch
Patch4: %{name}-security-code.patch
Patch5: %{name}-security-scripts.patch
@ -47,6 +47,8 @@ Patch8: signed-char.patch
Patch9: big-endian.patch
# bsc#1144255 disable jpeg2k support due to removal of jasper
Patch10: netpbm-disable-jasper.patch
# bsc#1170831 -- sent to bryanh@giraffe-data.com on 2020-05-04
Patch11: netpbm-pbmtonokia-cmdline-txt-null.patch
BuildRequires: flex
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
@ -102,6 +104,7 @@ source package.
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
mkdir pnmtopalm # for %%doc pnmtopalm
cp -p converter/other/pnmtopalm/{LICENSE,README} pnmtopalm
@ -119,8 +122,12 @@ export CFLAGS="%{optflags} -flax-vector-conversions"
export CFLAGS="$CFLAGS -O0"
%endif
%if %{asan_build}
export CFLAGS="$CFLAGS -fsanitize=address"
patch -p1 < %{PATCH1}
export CFLAGS="$CFLAGS -fsanitize=address -fno-sanitize-recover=all"
export LDFLAGS="$LDFLAGS -fsanitize=address"
%endif
%if %{ubsan_build}
export CFLAGS="$CFLAGS -fsanitize=undefined -fno-sanitize-recover=all"
export LDFLAGS="$LDFLAGS -fsanitize=undefined"
%endif
make %{?_smp_mflags} CFLAGS="$CFLAGS"
rm doc/INSTALL
@ -152,6 +159,12 @@ rm %{buildroot}%{_bindir}/pstopnm # disable due security reasons, e. g. [bsc#110
%postun -n libnetpbm%{libmaj} -p /sbin/ldconfig
%check
%if %{asan_build}
export LSAN_OPTIONS="detect_leaks=0"
%endif
%if %{ubsan_build}
export UBSAN_OPTIONS="print_stacktrace=1"
%endif
# do not run unneccesary tests
sed -i '/all-in-place/d' test/Test-Order
sed -i '/legacy-names/d' test/Test-Order