File more-check-for-buffer-size-when-write-multibyte-char.patch of Package util-linux.openSUSE_13.1_Update

From c36407293d63d428af176097527df89d623bc74f Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 1 Aug 2013 16:00:21 +0200
Subject: [PATCH] more: check for buffer size when write multibyte char

Signed-off-by: Karel Zak <kzak@redhat.com>
---
 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 3377118..9af15b3 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -912,7 +912,8 @@ int get_line(register FILE *f, int *length)
 					Fseek(f, file_pos_bak);
 					break_flag = 1;
 				} else {
-					for (i = 0; i < mbc_pos; i++)
+					for (i = 0; p < &Line[LineLen - 1] &&
+						    i < mbc_pos; i++)
 						*p++ = mbc[i];
 					if (wc_width > 0)
 						column += wc_width;
-- 
1.8.4

openSUSE Build Service is sponsored by