Re: Avoid possible overflow (src/port/bsearch_arg.c)

2024-10-28 Thread Heikki Linnakangas
On 28/10/2024 17:30, Tomas Vondra wrote: Some of those other implementations have fixed this, others have not. And they all seem to also have the "involes" typo in the comment that we fixed in commit 7ef8b52cf07 :-). Ranier, you might want to submit this fix to those other projects too. Thanks

Re: Avoid possible overflow (src/port/bsearch_arg.c)

2024-10-28 Thread Tomas Vondra
On 10/28/24 13:13, Heikki Linnakangas wrote: > On 09/10/2024 19:16, Ranier Vilela wrote: >> Em ter., 8 de out. de 2024 às 18:28, Nathan Bossart >> mailto:nathandboss...@gmail.com>> escreveu: >> >>     On Tue, Oct 08, 2024 at 04:09:00PM -0300, Ranier Vilela wrote: >> > The port function *bse

Re: Avoid possible overflow (src/port/bsearch_arg.c)

2024-10-28 Thread Ranier Vilela
Em seg., 28 de out. de 2024 às 09:13, Heikki Linnakangas escreveu: > On 09/10/2024 19:16, Ranier Vilela wrote: > > Em ter., 8 de out. de 2024 às 18:28, Nathan Bossart > > mailto:nathandboss...@gmail.com>> escreveu: > > > > On Tue, Oct 08, 2024 at 04:09:00PM -0300, Ranier Vilela wrote: > >

Re: Avoid possible overflow (src/port/bsearch_arg.c)

2024-10-28 Thread Heikki Linnakangas
On 09/10/2024 19:16, Ranier Vilela wrote: Em ter., 8 de out. de 2024 às 18:28, Nathan Bossart mailto:nathandboss...@gmail.com>> escreveu: On Tue, Oct 08, 2024 at 04:09:00PM -0300, Ranier Vilela wrote: > The port function *bsearch_arg* mimics the C function > *bsearch*. >

Re: Avoid possible overflow (src/port/bsearch_arg.c)

2024-10-09 Thread Ranier Vilela
Em ter., 8 de out. de 2024 às 18:28, Nathan Bossart < nathandboss...@gmail.com> escreveu: > On Tue, Oct 08, 2024 at 04:09:00PM -0300, Ranier Vilela wrote: > > The port function *bsearch_arg* mimics the C function > > *bsearch*. > > > > The API signature is: > > void * > > bsearch_arg(const void *k

Re: Avoid possible overflow (src/port/bsearch_arg.c)

2024-10-08 Thread Nathan Bossart
On Tue, Oct 08, 2024 at 04:09:00PM -0300, Ranier Vilela wrote: > The port function *bsearch_arg* mimics the C function > *bsearch*. > > The API signature is: > void * > bsearch_arg(const void *key, const void *base0, > size_t nmemb, size_t size, > int (*compar) (const void *, const void *, void *)

Avoid possible overflow (src/port/bsearch_arg.c)

2024-10-08 Thread Ranier Vilela
Hi. The port function *bsearch_arg* mimics the C function *bsearch*. The API signature is: void * bsearch_arg(const void *key, const void *base0, size_t nmemb, size_t size, int (*compar) (const void *, const void *, void *), void *arg) So, the parameter *nmemb* is size_t. Therefore, a call with