Re: [PATCH] scripts/dtc: Replace 0-length arrays with flexible arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 27, 2023 at 05:44:13PM -0600, Rob Herring wrote:
> On Fri, Jan 27, 2023 at 4:41 PM Kees Cook <keescook@xxxxxxxxxxxx> wrote:
> >
> > Replace the 0-length array with a C99 flexible array. Seen with GCC 13
> > under -fstrict-flex-arrays:
> >
> > In file included from ../lib/fdt_ro.c:2:
> > ../lib/../scripts/dtc/libfdt/fdt_ro.c: In function 'fdt_get_name':
> > ../lib/../scripts/dtc/libfdt/fdt_ro.c:319:24: warning: 'strrchr' reading 1 or more bytes from a region of size 0 [-Wstringop-overread]
> >   319 |                 leaf = strrchr(nameptr, '/');
> >       |                        ^~~~~~~~~~~~~~~~~~~~~
> >
> > Cc: Rob Herring <robh+dt@xxxxxxxxxx>
> > Cc: Frank Rowand <frowand.list@xxxxxxxxx>
> > Cc: devicetree@xxxxxxxxxxxxxxx
> > Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
> > ---
> >  scripts/dtc/libfdt/fdt.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Changes to dtc/libfdt go to upstream dtc first and then we sync them back.

Ah-ha, I've found it: https://github.com/dgibson/dtc

Thanks!

-- 
Kees Cook



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux