This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] BZ#13691: Fix a bug when converting strings with 1 character using TCVN5712-1


It isn't necessary to buffer the last character of strings. This can cause a
bug with strings that have 1 character between 0x0041 and 0x01b0.

2012-03-06 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>

	[BZ #13691]
	* iconvdata/tcvn5712-1.c (FROM_LOOP): Fix a bug when converting strings
	with only 1 character between 0x0041 and 0x01b0.
---
 NEWS                   |    4 ++--
 iconvdata/tcvn5712-1.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 35fc50f..99da87c 100644
--- a/NEWS
+++ b/NEWS
@@ -13,8 +13,8 @@ Version 2.16
   5077, 5461, 5805, 5993, 6884, 6907, 9739, 9902, 10110, 10135, 10140,
   10210, 11174, 11322, 11365, 11494, 12047, 13058, 13525, 13526, 13527,
   13528, 13529, 13530, 13531, 13532, 13533, 13547, 13551, 13552, 13553,
-  13555, 13559, 13583, 13618, 13637, 13656, 13695, 13704, 13706, 13738,
-  13786
+  13555, 13559, 13583, 13618, 13637, 13656, 13691, 13695, 13704, 13706,
+  13738, 13786
 
 * ISO C11 support:
 
diff --git a/iconvdata/tcvn5712-1.c b/iconvdata/tcvn5712-1.c
index 49d5430..cfcb60c 100644
--- a/iconvdata/tcvn5712-1.c
+++ b/iconvdata/tcvn5712-1.c
@@ -1,5 +1,5 @@
 /* Conversion to and from TCVN5712-1.
-   Copyright (C) 2001, 2002, 2004, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2004, 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
 
@@ -379,7 +379,7 @@ static const struct
     last_ch = *statep >> 3;						      \
 									      \
     /* We have to buffer ch if it is a possible match in comp_table_data.  */ \
-    must_buffer_ch = (ch >= 0x0041 && ch <= 0x01b0);			      \
+    must_buffer_ch = last_ch && (ch >= 0x0041 && ch <= 0x01b0);		      \
 									      \
     if (last_ch)							      \
       {									      \
-- 
1.7.4.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]