public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] __gconv_translit_find: Actually append ".so" to module name [BZ #17187]
@ 2014-07-21 13:01 Florian Weimer
  2014-07-28 23:02 ` Roland McGrath
  2014-08-21 17:33 ` [PATCH v1.1] " Florian Weimer
  0 siblings, 2 replies; 20+ messages in thread
From: Florian Weimer @ 2014-07-21 13:01 UTC (permalink / raw)
  To: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

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

[-- Attachment #2: 0001-__gconv_translit_find-Actually-append-.so-to-module-.patch --]
[-- Type: text/x-patch, Size: 1118 bytes --]

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


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2014-08-26 18:45 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-21 13:01 [PATCH] __gconv_translit_find: Actually append ".so" to module name [BZ #17187] Florian Weimer
2014-07-28 23:02 ` Roland McGrath
2014-07-29  5:50   ` Florian Weimer
     [not found]     ` <CAJ_zFkJLdEpJzKSM3HDN6PuVriTd4vKNqq=EubtCR5qqvt1U8g@mail.gmail.com>
2014-07-29 19:05       ` Florian Weimer
2014-07-31 18:09         ` Tavis Ormandy
2014-07-31 20:29           ` Joseph S. Myers
2014-08-08 15:34   ` Florian Weimer
2014-08-21 17:33 ` [PATCH v1.1] " Florian Weimer
2014-08-26  6:35   ` Siddhesh Poyarekar
2014-08-26  9:52     ` Florian Weimer
2014-08-26 11:23       ` Allan McRae
2014-08-26 14:33         ` Carlos O'Donell
2014-08-26 16:46           ` Carlos O'Donell
2014-08-26 12:09   ` Andreas Schwab
2014-08-26 12:25     ` Florian Weimer
2014-08-26 14:36       ` Carlos O'Donell
2014-08-26 16:45   ` Carlos O'Donell
2014-08-26 16:55     ` Florian Weimer
2014-08-26 17:54       ` Carlos O'Donell
2014-08-26 18:45       ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).