From 34b3e62806ccc9b2f844a81cbd19be68c8de9cc6b7c0f549b4b3ce51d4a7ad40 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 27 Sep 2013 20:15:17 +0000 Subject: [PATCH] Accepting request 201207 from home:mgorse:branches:Base:System - Add more-fix-buffer-overflow.patch (bnc#829720). OBS-URL: https://build.opensuse.org/request/show/201207 OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=182 --- more-fix-buffer-overflow.patch | 32 ++++++++++++++++++++++++++++++++ util-linux.changes | 5 +++++ util-linux.spec | 3 +++ 3 files changed, 40 insertions(+) create mode 100644 more-fix-buffer-overflow.patch diff --git a/more-fix-buffer-overflow.patch b/more-fix-buffer-overflow.patch new file mode 100644 index 0000000..f41bb16 --- /dev/null +++ b/more-fix-buffer-overflow.patch @@ -0,0 +1,32 @@ +From 1ef2db5a5672e09fa1337099b7d9d6ab61c19bdc Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 1 Aug 2013 12:58:22 +0200 +Subject: [PATCH] more: fix buffer overflow + +The bug has been probably introduced by commit +1ac300932deab8dea2c43050921bbbdb36d62ff1. + +Reported-by: "Dr. David Alan Gilbert" +References: https://bugzilla.novell.com/show_bug.cgi?id=829720 +Signed-off-by: Karel Zak +--- + text-utils/more.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/text-utils/more.c b/text-utils/more.c +index 3bbeede..3377118 100644 +--- a/text-utils/more.c ++++ b/text-utils/more.c +@@ -835,7 +835,8 @@ void prepare_line_buffer(void) + if (nsz < LINSIZ) + nsz = LINSIZ; + +- nline = xrealloc(Line, nsz); ++ /* alloc nsz and extra space for \n\0 */ ++ nline = xrealloc(Line, nsz + 2); + Line = nline; + LineLen = nsz; + } +-- +1.8.4 + diff --git a/util-linux.changes b/util-linux.changes index d70cc6c..d724676 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Sep 27 16:58:40 UTC 2013 - mgorse@suse.com + +- Add more-fix-buffer-overflow.patch (bnc#829720). + ------------------------------------------------------------------- Fri Sep 13 07:06:19 UTC 2013 - werner@suse.de diff --git a/util-linux.spec b/util-linux.spec index 81e2fc2..78c81ea 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -100,6 +100,8 @@ Patch3: fdisk-tinfo.patch Patch4: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff # PATCH-FIX-UPSTREAM eject-scsi-check-host_status-and-driver_status.patch bnc358033 anicka@suse.cz -- Check eject host_status and driver_status when using SG_IO. Patch5: eject-scsi-check-host_status-and-driver_status.patch +# PATCH-FIX-UPSTREAM more-fix-buffer-overflow.patch bnc839720 mgorse@suse.com -- More: Fix under-allocation of memory. +Patch6: more-fix-buffer-overflow.patch # disable encryption Patch12: util-linux-2.23.1-noenc-suse.diff @@ -219,6 +221,7 @@ xzcat %{S:0} | %gpg_verify %{S:12} - %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %patch12 -p1 # %patch20 -p1