hw/core/sysbus: Assert memory region index is in range
commitf234501c67234d54dc75f34eb76988c929778070
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Thu, 6 Aug 2020 13:09:45 +0000 (6 15:09 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Tue, 1 Sep 2020 07:28:28 +0000 (1 09:28 +0200)
tree882c2b1c63ce38cf157063edf26798bc9145341f
parentcc6498ec6e9e11c0b2d055efbf2f2bc518c73b3a
hw/core/sysbus: Assert memory region index is in range

Devices incorrectly modelled might use invalid index while
calling sysbus_mmio_get_region(), leading to OOB access.
Help developers by asserting the index is in range.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200806130945.21629-3-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/core/sysbus.c