This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] __gconv_translit_find: Actually append ".so" to module name [BZ #17187]
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 21 Jul 2014 15:01:09 +0200
- Subject: [PATCH] __gconv_translit_find: Actually append ".so" to module name [BZ #17187]
- Authentication-results: sourceware.org; auth=none
The previous code wrote the string after the terminating NUL character
of the existing module name. This had two effects: the ".so" extension
was not actually visible in the module name string, and a NUL byte was
written byond the end of the allocated buffer.
I'm not sure how to add a functionality test for this. The test suite
does not show any changes in behavior.
--
Florian Weimer / Red Hat Product Security
2014-07-21 Florian Weimer <fweimer@redhat.com>
[BZ #17187]
* iconv/gconv_trans.c (__gconv_translit_find): Actually append
".so" to form the module name.
diff --git a/NEWS b/NEWS
index 63be362..b30fd06 100644
--- a/NEWS
+++ b/NEWS
@@ -22,7 +22,7 @@ Version 2.20
16927, 16928, 16932, 16943, 16958, 16965, 16966, 16967, 16977, 16978,
16984, 16990, 16996, 17009, 17022, 17031, 17042, 17048, 17050, 17058,
17061, 17062, 17069, 17075, 17078, 17079, 17084, 17086, 17088, 17092,
- 17097, 17125, 17135, 17137, 17153.
+ 17097, 17125, 17135, 17137, 17153, 17187.
* Optimized strchr implementation for AArch64. Contributed by ARM Ltd.
diff --git a/iconv/gconv_trans.c b/iconv/gconv_trans.c
index 1e25854..921020b 100644
--- a/iconv/gconv_trans.c
+++ b/iconv/gconv_trans.c
@@ -389,7 +389,7 @@ __gconv_translit_find (struct trans_struct *trans)
cp = __mempcpy (__stpcpy ((char *) newp->fname, runp->name),
trans->name, name_len);
if (need_so)
- memcpy (cp, ".so", sizeof (".so"));
+ memcpy (cp - 1, ".so", sizeof (".so"));
if (open_translit (newp) == 0)
{
--
1.9.3