From patchwork Mon Jul 21 13:01:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 2123 Received: (qmail 31285 invoked by alias); 21 Jul 2014 13:01:15 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 31265 invoked by uid 89); 21 Jul 2014 13:01:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Message-ID: <53CD0F15.3030806@redhat.com> Date: Mon, 21 Jul 2014 15:01:09 +0200 From: Florian Weimer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: GNU C Library Subject: [PATCH] __gconv_translit_find: Actually append ".so" to module name [BZ #17187] 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. 2014-07-21 Florian Weimer [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