Reported-by: Mauro Condarelli <mc5686@mclink.it>
Fixes: #13155 - _fireinfo.detect_hypervisor() rises Segmentation fault
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
HYPER_KVM,
HYPER_MSHV,
HYPER_VMWARE,
+ // Must always be last
HYPER_OTHER,
- HYPER_LAST /* for loop - must be last*/
};
const char *hypervisor_ids[] = {
*hypervisor = HYPER_OTHER;
if (*sig.text) {
- for (int id = HYPER_NONE + 1; id < HYPER_LAST; id++) {
+ for (int id = HYPER_NONE + 1; id < HYPER_OTHER; id++) {
if (strcmp(hypervisor_ids[id], sig.text) == 0) {
*hypervisor = id;
break;