Also check lower bound for attr cast to int

This commit is contained in:
dmiller 2025-07-15 18:24:40 +00:00
parent c40965039b
commit 117329a5e4

View file

@ -245,7 +245,7 @@ struct ObservationPrint {
FingerPrintScan scan_info;
std::vector<FingerTest> extra_tests;
const char *getInfo(FingerPrintScan::Attribute attr) const {
if (attr >= FingerPrintScan::MAX_ATTR)
if (attr >= FingerPrintScan::MAX_ATTR || attr < 0)
return NULL;
return scan_info.values[static_cast<int>(attr)];
}