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: 372058 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2AE2814010C for ; Mon, 21 Jul 2014 23:01:21 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type; q=dns; s=default; b=UGxtmuZ6ZmElz+jpX3SoSqbxYwulY VEk7k3fsONXBLOUdqDQFYxX7voAhfOn+aF9aC+JE4Ejnx8cYny1a9QtlW7hZcRHY nSbGUvu/W7FVHJ7Z+LDHCLQPNg66bylgDz/hWzBHK0WW6vAdPqvS1+8bxQKcgNaT 6M9UZ8kQpkdMJU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type; s=default; bh=OYksXwyR816NHE9WkXxft8vzb0I=; b=rk3 dJImG+LpS7hWm6b8J7auK2iNM9BY/t1yyAMS4H96JVFNGyGM9KEHRiFcwNgqdphO uYupuHFGHbmPoYP/HOBeiRHo3G4yAbgL06aqQR6kOfWLbVe3O7jLFyGTryEmMh4g 4tF2YEdoYBCq1Kip2sY10OhEzuY8nIQKzKsSoyQ8= 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