diff --git a/zutils-1.7-zcat-buffer-overrun.patch b/zutils-1.7-zcat-buffer-overrun.patch new file mode 100644 index 0000000..89cc490 --- /dev/null +++ b/zutils-1.7-zcat-buffer-overrun.patch @@ -0,0 +1,18 @@ +Author: Antonio Diaz Diaz +Description: zcat.cc: Fixed a buffer overrun on outbuf when '-v' is used. + +diff -Naurp zutils/zcat.cc zutils/zcat.cc +--- zutils/zcat.cc ++++ zutils/zcat.cc +@@ -232,8 +232,9 @@ int cat( int infd, const int format_inde + enum { buffer_size = 4096 }; + // buffer with space for sentinel newline at the end + uint8_t * const inbuf = new uint8_t[buffer_size+1]; +- // buffer with space for character quoting and 255-digit line number +- uint8_t * const outbuf = new uint8_t[(4*buffer_size)+256]; ++ // buffer with space for character quoting, 255-digit line number and ++ // worst case flushing respect to inbuf. ++ uint8_t * const outbuf = new uint8_t[(5*buffer_size)+256]; + int retval = 0; + Children children; + if( !set_data_feeder( input_filename, &infd, children, format_index ) ) diff --git a/zutils.changes b/zutils.changes index ba94bae..9ebfbd1 100644 --- a/zutils.changes +++ b/zutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 6 10:29:51 UTC 2018 - aloisio@gmx.com + +- Added zutils-1.7-zcat-buffer-overrun.patch (fixes boo#1103878) + ------------------------------------------------------------------- Sat Jul 14 08:27:03 UTC 2018 - antoine.belvire@opensuse.org diff --git a/zutils.spec b/zutils.spec index fe870d2..87c7246 100644 --- a/zutils.spec +++ b/zutils.spec @@ -26,6 +26,8 @@ URL: https://www.nongnu.org/zutils/zutils.html Source0: https://download.savannah.gnu.org/releases/zutils/zutils-%{version}.tar.lz Source1: https://download.savannah.gnu.org/releases/zutils/zutils-%{version}.tar.lz.sig Source2: %{name}.keyring +# PATCH-FIX-UPSTREAM zutils-1.7-zcat-buffer-overrun.patch +Patch0: zutils-1.7-zcat-buffer-overrun.patch BuildRequires: gcc-c++ BuildRequires: lzip Requires(post): %{install_info_prereq} @@ -44,6 +46,7 @@ in those utilities supporting it. %prep %setup -q +%patch0 -p1 %build %configure