On 12/15/22 10:13, Ales Musil wrote: > Compiling with GCC and -fsanitize=undefined throws > a warning [0]. To avoid that, use the original > ovnact pointer with the inner size rather than getting > the inner "struct ovnact" from the "struct ovnact_load". > > At the same time simplify the computation of size for > ovnacts_format call. > > [0] > In function ‘execute_load’, > inlined from ‘trace_actions.part.0.isra’ at utilities/ovn-trace.c:3075:13: > utilities/ovn-trace.c:1501:5: error: ‘ovnacts_encode’ reading 4 bytes from a > region of size 1 [-Werror=stringop-overread] > 1501 | ovnacts_encode(&load->ovnact, sizeof *load, &ep, &ofpacts); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > utilities/ovn-trace.c:1501:5: note: referencing argument 1 of type ‘const > struct ovnact[0]’ > In file included from utilities/ovn-trace.c:35: > ./include/ovn/actions.h: In function ‘trace_actions.part.0.isra’: > ./include/ovn/actions.h:869:6: note: in a call to function ‘ovnacts_encode’ > 869 | void ovnacts_encode(const struct ovnact[], size_t ovnacts_len, > | ^~~~~~~~~~~~~~ > In function ‘execute_load’, > inlined from ‘trace_actions.part.0.isra’ at utilities/ovn-trace.c:3075:13: > utilities/ovn-trace.c:1509:13: error: ‘ovnacts_format’ reading 4 bytes from a > region of size 1 [-Werror=stringop-overread] > 1509 | ovnacts_format(&load->ovnact, OVNACT_LOAD_SIZE, &s); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > utilities/ovn-trace.c:1509:13: note: referencing argument 1 of type ‘const > struct ovnact[0]’ > ./include/ovn/actions.h: In function ‘trace_actions.part.0.isra’: > ./include/ovn/actions.h:792:6: note: in a call to function ‘ovnacts_format’ > 792 | void ovnacts_format(const struct ovnact[], size_t ovnacts_len, struct > ds *); > | ^~~~~~~~~~~~~~ > > Signed-off-by: Ales Musil <[email protected]> > ---
Looks good to me, thanks! Acked-by: Dumitru Ceara <[email protected]> _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
