From ad5f3b559ad9a71ae48a2d722989e36587a0bca5 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 7 Feb 2024 21:35:39 +0200 Subject: [PATCH 10/10] sdl2: Fix NULL dereference in popup_tech_info() See osdn #48687 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/helpdlg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/gui-sdl2/helpdlg.c b/client/gui-sdl2/helpdlg.c index 2d8bc8007b..4dcbfd0fb7 100644 --- a/client/gui-sdl2/helpdlg.c +++ b/client/gui-sdl2/helpdlg.c @@ -2073,7 +2073,7 @@ void popup_tech_info(Tech_type_id tech) int count = help_dlg->scroll->active; advance_label = help_dlg->active_widget_list; - while (advance_label && count--) { + while (advance_label->prev != NULL && count--) { advance_label = advance_label->prev; } advance_label = advance_label->next; -- 2.43.0