This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] _nl_load_domain: Use calloc instead of alloca
- From: Florian Weimer <fweimer at redhat dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org
- Date: Wed, 21 Jun 2017 23:11:38 +0200
- Subject: Re: [PATCH] _nl_load_domain: Use calloc instead of alloca
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9793F7A16D
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9793F7A16D
- References: <20170619161833.6D6BC402AEC0E@oldenburg.str.redhat.com> <89eb62c9-1d11-221f-2aea-d0b7d44864cf@linaro.org>
On 06/21/2017 09:53 PM, Adhemerval Zanella wrote:
>
>
> On 19/06/2017 13:18, Florian Weimer wrote:
>> 2017-06-19 Florian Weimer <fweimer@redhat.com>
>>
>> * intl/loadmsgcat.c: Remove alloca support.
>> (_nl_load_domain): Use calloc instead of alloca.
>
> LGTM, thanks.
Thanks, I pushed it with a small change:
- sysdep_segment_values =
- (const char **)
- alloca (n_sysdep_segments * sizeof (const char *));
+ sysdep_segment_values = calloc
+ (n_sysdep_segments, sizeof (const char *));
+ if (sysdep_segment_values == NULL)
+ goto invalid;
(The calloc return value check is new.)
Florian