On June 5, 2014 2:34:00 PM CEST, Otto Moerbeek <o...@drijf.net> wrote:
>OK,
>
>Grrr... messed this up, sent thw wrong version. Both the To: header
>and the text contain errors, but the intend should be clear. Diff is
>the right version. 
>
>Take care when replying.
>
>       -Otto
>
>On Thu, Jun 05, 2014 at 02:22:01PM +0200, Otto Moerbeek wrote:
>
>> Hi,
>> 
>> The new malloc has been comitted, so now take the next step.
>> 
>> This changes _dl_malloc to a regular non-zeroing _dl_malloc and uses
>> _dl_calloc and _dl_reallocarray.
>> 
>> This needs carefull review. I left some malloc calls since they do
>not
>> require zero'ing according to my analysis, but this easy to get
>wrong.
>> This also hold fo changes to _dl_reallocarray, since it does not
>zero,
>> while the old _dl_malloc did. 
>> 
>> Some parts of this diff extracted from a diff by deraadt@
>> 
>> Pleas review and test.
>> 
>>      -Otto
>> 


>> RCS file: /cvs/src/libexec/ld.so/dl_prebind.c,v
>> retrieving revision 1.13
>> diff -u -p -r1.13 dl_prebind.c
>> --- dl_prebind.c     13 Nov 2013 05:41:41 -0000      1.13
>> +++ dl_prebind.c     5 Jun 2014 11:22:35 -0000
>> @@ -200,7 +200,8 @@ prebind_symcache(elf_object_t *object, i
>>              if (i <= NUM_STATIC_OBJS) {
>>                      objarray = &objarray_static[0];
>>              } else {
>> -                    objarray = _dl_malloc(sizeof(elf_object_t *) * i);
>> +                    objarray = _dl_reallocarray(NULL,
>> +                        sizeof(elf_object_t *), i);

Nit, so please disregard if considered bikeshedding at this point, but for 
style the sizeof and i should be switched.

/Alexander

Reply via email to