Linux SPD accessors out-of-bounds check

master
Kasslim 4 months ago committed by Adam Honse
parent ccee553257
commit c1db812b67

@ -47,6 +47,12 @@ uint8_t EE1004Accessor::at(uint16_t addr)
{
readEEPROM();
}
// Prevent indexing out of bounds
if(addr >= sizeof(dump))
{
return 0xFF;
}
return dump[addr];
}

@ -48,6 +48,12 @@ uint8_t SPD5118Accessor::at(uint16_t addr)
{
readEEPROM();
}
// Prevent indexing out of bounds
if(addr >= sizeof(dump))
{
return 0xFF;
}
return dump[addr];
}

Loading…
Cancel
Save