nfp: add validity check of island and me
authorYinjun Zhang <yinjun.zhang@corigine.com>
Thu, 26 Aug 2021 01:01:17 +0000 (21:01 -0400)
committerAlan Modra <amodra@gmail.com>
Wed, 1 Sep 2021 00:56:26 +0000 (10:26 +0930)
commit90f56146e5748bab6baca97b1470bbd144ae10e8
tree8552b815ab856d33acb8cc992ce9213fd54b2e2b
parent64cb17196c7b2365ec152991235e686e6dc27a18
nfp: add validity check of island and me

AddressSanitizer detects heap-buffer-overflow when running
"objdump -D" for nfp .nffw files.

PR 27854
* nfp-dis.c (_NFP_ISLAND_MAX, _NFP_ME_MAX): Define.
(nfp_priv_data): ..and use here.
(_print_instrs): Sanity check island and menum.

Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
opcodes/nfp-dis.c