Re: [PATCH] overflow.h: Add flex_array_size() helper

2020-06-09 Thread Kees Cook
On Mon, Jun 08, 2020 at 03:34:52PM -0700, Joe Perches wrote: > On Mon, 2020-06-08 at 17:17 -0500, Gustavo A. R. Silva wrote: > > Add flex_array_size() helper for the calculation of the size, in bytes, > > of a flexible array member contained within an enclosing structure. > > > > Example of

Re: [PATCH] overflow.h: Add flex_array_size() helper

2020-06-08 Thread Gustavo A. R. Silva
On Mon, Jun 08, 2020 at 03:34:52PM -0700, Joe Perches wrote: > On Mon, 2020-06-08 at 17:17 -0500, Gustavo A. R. Silva wrote: > > Add flex_array_size() helper for the calculation of the size, in bytes, > > of a flexible array member contained within an enclosing structure. > > > > Example of

Re: [PATCH] overflow.h: Add flex_array_size() helper

2020-06-08 Thread Joe Perches
On Mon, 2020-06-08 at 17:17 -0500, Gustavo A. R. Silva wrote: > Add flex_array_size() helper for the calculation of the size, in bytes, > of a flexible array member contained within an enclosing structure. > > Example of usage: > foo > struct something { > size_t count; > struct foo

[PATCH] overflow.h: Add flex_array_size() helper

2020-06-08 Thread Gustavo A. R. Silva
Add flex_array_size() helper for the calculation of the size, in bytes, of a flexible array member contained within an enclosing structure. Example of usage: struct something { size_t count; struct foo items[]; }; struct something *instance; instance =