Re: [PATCH][next] media: venus: Replace one-element arrays with flexible-array members

From: Kees Cook
Date: Tue May 16 2023 - 16:18:45 EST


On Tue, May 16, 2023 at 02:17:32PM -0600, Gustavo A. R. Silva wrote:
> One-element arrays are deprecated, and we are replacing them with flexible
> array members instead. So, replace one-element arrays with flexible-array
> members in multiple structures, and refactor the rest of the code,
> accordingly.
>
> This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
> routines on memcpy() and help us make progress towards globally
> enabling -fstrict-flex-arrays=3 [1].
>
> This results in no differences in binary output.
>
> Link: https://github.com/KSPP/linux/issues/79
> Link: https://github.com/KSPP/linux/issues/291
> Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1]
> Signed-off-by: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>

Oh fun, a subtraction variant! :)

Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

--
Kees Cook