lkml.org 
[lkml]   [2021]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 3/5] treewide: Replace 0-element memcpy() destinations with flexible arrays
Date
Kees Cook <keescook@chromium.org> writes:

> In some cases, use of the flex_array() helper is needed when a flexible
> array is part of a union.

The code below seems to show that the helper is also needed when the
flexible array is the only member of a struct? Or is this just an
extension of the 'part of a union' clause?

> @@ -160,7 +160,7 @@ struct bmi_cmd {
>
> union bmi_resp {
> struct {
> - u8 payload[0];
> + DECLARE_FLEX_ARRAY(u8, payload);
> } read_mem;
> struct {
> __le32 result;

--
-keith
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-08-26 07:25    [W:0.094 / U:2.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site