From: Christian Heldt Date: Sun, 30 Nov 2025 14:04:46 +0000 (+0100) Subject: hdspmixer: fix null pointer dereference in HDSPMixerWindow:handler_cb X-Git-Tag: v1.2.15~2 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=a3fd2c53b6a8bd1b80e993e91036c91a5fe59ec9;p=alsa-tools.git hdspmixer: fix null pointer dereference in HDSPMixerWindow:handler_cb Closes: https://github.com/alsa-project/alsa-tools/pull/42 Signed-off-by: Christian Heldt Signed-off-by: Jaroslav Kysela --- diff --git a/hdspmixer/src/HDSPMixerWindow.cxx b/hdspmixer/src/HDSPMixerWindow.cxx index 4a911c1..1450258 100644 --- a/hdspmixer/src/HDSPMixerWindow.cxx +++ b/hdspmixer/src/HDSPMixerWindow.cxx @@ -274,15 +274,15 @@ static int handler_cb(int event) { HDSPMixerWindow *w = NULL; Fl_Window *fl_win = Fl::first_window(); - while (1) { - if (fl_win->label()) { - if (strncmp("HDSPMixer", fl_win->label(), 9) == 0) { - w = (HDSPMixerWindow *)fl_win; - break; + while (fl_win) { + if (fl_win->label()) { + if (strncmp("HDSPMixer", fl_win->label(), 9) == 0) { + w = (HDSPMixerWindow *)fl_win; + break; + } } + fl_win = Fl::next_window(fl_win); } - if ((fl_win = Fl::next_window(fl_win))) return 0; - } if (!w) return 0; int key = Fl::event_key(); switch (event) {