summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-08-01 00:31:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-08-01 00:31:03 +0000
commit43965879932720b480149511aa85f8d848c060fc (patch)
tree8a24e6fbf54bfb5be9e6c77e711e357565f1fd71
parentReleasing debian version 1.7-2. (diff)
downloadzutils-43965879932720b480149511aa85f8d848c060fc.tar.xz
zutils-43965879932720b480149511aa85f8d848c060fc.zip
Adding patch from upstream to fix a buffer overrun in zcat (Closes: #902936).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/patches/series1
-rw-r--r--debian/patches/upstream/0001-zcat-buffer-overrun.patch18
2 files changed, 19 insertions, 0 deletions
diff --git a/debian/patches/series b/debian/patches/series
index a353e88..fdb9b2d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
debian/0001-build.patch
debian/0002-zupdate.patch
+upstream/0001-zcat-buffer-overrun.patch
diff --git a/debian/patches/upstream/0001-zcat-buffer-overrun.patch b/debian/patches/upstream/0001-zcat-buffer-overrun.patch
new file mode 100644
index 0000000..92d98a6
--- /dev/null
+++ b/debian/patches/upstream/0001-zcat-buffer-overrun.patch
@@ -0,0 +1,18 @@
+Author: Antonio Diaz Diaz <antonio@gnu.org>
+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 ) )