elf2dmp: check array bounds in pdb_get_file_size
commit9d9c06b144da340b9a937ed01d45a936810715be
authorViktor Prutyanov <viktor@daynix.com>
Sat, 30 Sep 2023 23:53:17 +0000 (1 02:53 +0300)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 19 Oct 2023 13:32:12 +0000 (19 14:32 +0100)
treeef495b15f63fc8bd5d0540aff181cebafb7d1a9f
parent8b01683e857a80425ea67dc44505b4983fc11a8e
elf2dmp: check array bounds in pdb_get_file_size

Index in file_size array must be checked against num_files, because the
entries we are looking for may be absent in the PDB.

Fixes: Coverity CID 1521597
Signed-off-by: Viktor Prutyanov <viktor@daynix.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230930235317.11469-3-viktor@daynix.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
contrib/elf2dmp/pdb.c