From patchwork Wed Dec 10 13:21:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Bilka X-Patchwork-Id: 4138 Received: (qmail 2292 invoked by alias); 10 Dec 2014 13:22:25 -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 2279 invoked by uid 89); 10 Dec 2014 13:22:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: popelka.ms.mff.cuni.cz Date: Wed, 10 Dec 2014 14:21:53 +0100 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= To: libc-alpha@sourceware.org Subject: [PATCH][BZ #17657] Return allocated array instead array on stack. Message-ID: <20141210132153.GA6395@domone> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Hi, here we return array on stack which is invalid. OK to fix it in obvious way? [BZ #17657] * locale/programs/ld-ctype.c (find_translit2): Allocate returned array. diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c index 67846b3..103fc63 100644 --- a/locale/programs/ld-ctype.c +++ b/locale/programs/ld-ctype.c @@ -1777,7 +1777,7 @@ find_translit2 (struct locale_ctype_t *ctype, const struct charmap_t *charmap, for (wi = tirunp->from; wi <= wch; wi += tirunp->step) if (wi == wch) - return (uint32_t []) { 0 }; + return (uint32_t *) xcalloc (1, sizeof (uint32_t)); } }