aboutsummaryrefslogtreecommitdiffstats
path: root/components/volume.c
diff options
context:
space:
mode:
authorChris Billington <emulti@disroot.org>2025-11-21 12:31:40 +0800
committerdrkhsh <me@drkhsh.at>2026-02-12 22:45:28 +0100
commit6fa36bad9f74154d4bf3be834ada93e04bf737e1 (patch)
treede5d425c1eb9537d99b91df2dc8457ae3ae6ad8c /components/volume.c
parent8723e8b8c69c08bae8abe02ea1f4a49758b8bdfc (diff)
downloadslstatus-6fa36bad9f74154d4bf3be834ada93e04bf737e1.tar.gz
volume: avoid NULL dereference in onval() on sndio device switch
Diffstat (limited to 'components/volume.c')
-rw-r--r--components/volume.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/components/volume.c b/components/volume.c
index 6cec556..5a2bfb7 100644
--- a/components/volume.c
+++ b/components/volume.c
@@ -89,6 +89,8 @@
if (c->addr == addr)
break;
}
+ if (c == NULL)
+ return;
c->val = val;
}