lkml.org 
[lkml]   [2022]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] xfrm: convert alg_key to flexible array member
On Tue, May 24, 2022 at 01:47:40PM -0700, Stephen Hemminger wrote:
> Iproute2 build generates a warning when built with gcc-12.
> This is because the alg_key in xfrm.h API has zero size
> array element instead of flexible array.
>
> CC xfrm_state.o
> In function ‘xfrm_algo_parse’,
> inlined from ‘xfrm_state_modify.constprop’ at xfrm_state.c:573:5:
> xfrm_state.c:162:32: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
> 162 | buf[j] = val;
> | ~~~~~~~^~~~~
>
> This patch convert the alg_key into flexible array member.
> There are other zero size arrays here that should be converted as
> well.
>
> This patch is RFC only since it is only compile tested and
> passes trivial iproute2 tests.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> include/uapi/linux/xfrm.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

\
 
 \ /
  Last update: 2022-05-25 02:16    [W:1.366 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site