public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: GNU C Library <libc-alpha@sourceware.org>
Subject: [PATCH] __gconv_translit_find: Actually append ".so" to module name [BZ #17187]
Date: Mon, 21 Jul 2014 13:01:00 -0000	[thread overview]
Message-ID: <53CD0F15.3030806@redhat.com> (raw)

[-- 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


             reply	other threads:[~2014-07-21 13:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21 13:01 Florian Weimer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53CD0F15.3030806@redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).