From 8460a7822c84fc1317efabaa3a47ccb753fc8cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20J=2E=20Saraiva?= Date: Sun, 6 Oct 2024 03:40:40 +0100 Subject: [PATCH] Fix null check in cpu_group_find_highest_id. Fixes #251 --- stable/cpu.c | 2 +- unstable/cpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stable/cpu.c b/stable/cpu.c index 49977b3ea..e5f3dee6d 100644 --- a/stable/cpu.c +++ b/stable/cpu.c @@ -50,7 +50,7 @@ int cpu_group_find_highest_id(cpu_group_t *group,u_int *highest_id) cpu_gen_t *cpu; u_int max_id = 0; - if (!group || group->cpu_list) + if (!group || !group->cpu_list) return(-1); for(cpu=group->cpu_list;cpu;cpu=cpu->next) diff --git a/unstable/cpu.c b/unstable/cpu.c index e03fb36bc..766fb1fed 100644 --- a/unstable/cpu.c +++ b/unstable/cpu.c @@ -51,7 +51,7 @@ int cpu_group_find_highest_id(cpu_group_t *group,u_int *highest_id) cpu_gen_t *cpu; u_int max_id = 0; - if (!group || group->cpu_list) + if (!group || !group->cpu_list) return(-1); for(cpu=group->cpu_list;cpu;cpu=cpu->next)