This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] _nl_load_domain: Use calloc instead of alloca


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]