Re: use mallocarray in kern

2014-07-14 Thread Henri Kemppainen
If you look at the diff that went in already, it's using mallocarray. It wouldn't even compile otherwise.

Re: use mallocarray in kern

2014-07-14 Thread Philipp
Sorry to break the threading, but I already expunged the original message.. Re: http://marc.info/?l=openbsd-tech&m=140529530814733&w=2 The second and third hunk should use mallocarray() instead of malloc() in my eyes. sizeof(Elf_Phdr) as type just doesnt make sense to me. Hope not "everyone"

Re: use mallocarray in kern

2014-07-13 Thread Theo de Raadt
> On Sun, Jul 13, 2014 at 17:52, Theo de Raadt wrote: > >> And some others from exec that follow a slightly different pattern. > > > > This is the pattern I have been following as well. > > > > As for the final diff, I've been giving up on the "known constant" > > scenario. It seems expensive. >

Re: use mallocarray in kern

2014-07-13 Thread Ted Unangst
On Sun, Jul 13, 2014 at 17:52, Theo de Raadt wrote: >> And some others from exec that follow a slightly different pattern. > > This is the pattern I have been following as well. > > As for the final diff, I've been giving up on the "known constant" > scenario. It seems expensive. Meh. :) I thin

Re: use mallocarray in kern

2014-07-13 Thread Theo de Raadt
> And some others from exec that follow a slightly different pattern. This is the pattern I have been following as well. As for the final diff, I've been giving up on the "known constant" scenario. It seems expensive. > Index: exec_script.c >

Re: use mallocarray in kern

2014-07-13 Thread Ted Unangst
On Sun, Jul 13, 2014 at 11:14, Ted Unangst wrote: > sprinkle malloc array in the kern directory. And some others from exec that follow a slightly different pattern. Index: exec_elf.c === RCS file: /cvs/src/sys/kern/exec_elf.c,v retri

use mallocarray in kern

2014-07-13 Thread Ted Unangst
sprinkle malloc array in the kern directory. Index: exec_subr.c === RCS file: /cvs/src/sys/kern/exec_subr.c,v retrieving revision 1.36 diff -u -p -r1.36 exec_subr.c --- exec_subr.c 12 Jul 2014 18:43:32 - 1.36 +++ exec_subr.c