u-boot-brain/board/xilinx
Heinrich Schuchardt b6d14c52f9 fru: ops: avoid out of bounds access
Building xilinx_zynq_virt_defconfig fails on origin/next as reported by
GCC 10.2 (as provided by Debian Bullseye):

  CC      board/xilinx/common/fru_ops.o
board/xilinx/common/fru_ops.c: In function ‘fru_capture’:
board/xilinx/common/fru_ops.c:173:8:
error: array subscript 284 is outside array bounds of
‘struct fru_table[1]’ [-Werror=array-bounds]
  173 |  limit = data + sizeof(struct fru_board_data);
      |  ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
board/xilinx/common/fru_ops.c:17:18: note: while referencing ‘fru_data’
   17 | struct fru_table fru_data __section(.data);
      |                  ^~~~~~~~

When using sizeof(struct fru_board_data) to find the end of the structure
you should add it to the start of the structure.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2021-01-05 11:54:53 +01:00
..
bootscripts xilinx: Add sd boot command script for reference 2019-10-08 09:11:13 +02:00
common fru: ops: avoid out of bounds access 2021-01-05 11:54:53 +01:00
microblaze-generic microblaze: Set script_offset_nor env variable 2021-01-04 10:51:27 +01:00
versal xilinx: common: Add Makefile to common folder 2020-10-27 08:13:32 +01:00
zynq xilinx: common: Add Makefile to common folder 2020-10-27 08:13:32 +01:00
zynqmp mmc: zynq_sdhci: Add common function to set input/output tapdelays 2020-10-29 08:55:43 +01:00
zynqmp_r5 common: Drop init.h from common header 2020-05-18 17:33:33 -04:00
Kconfig xilinx: Merge together BOOT_SCRIPT_OFFSET between MB and ARM 2020-10-27 08:13:33 +01:00