base-hw/muen: add explicit array-bounds check

This commit is contained in:
Norman Feske 2020-01-07 17:37:35 +01:00 committed by Christian Helmuth
parent 5635c1318c
commit de764d8490

View File

@ -40,12 +40,13 @@ class Board::Pic
void irq_occurred(unsigned irq)
{
if (irq < NR_OF_IRQ)
isr[irq] = true;
}
bool take_request(unsigned &irq)
{
for (int i = 0; i < 256; i++) {
for (int i = 0; i < NR_OF_IRQ; i++) {
if (isr[i] == true) {
irq = i;
isr[i] = false;