fix use of uninitialized volume in OSS mixer - slstatus - status monitor
HTML git clone git://git.suckless.org/slstatus
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 60b28d8a78b14ecc43f1c7d177cfa5f8597e2071
DIR parent 7a8545952ef647e6862c5b184aee0b13a48e741d
HTML Author: drkhsh <me@drkhsh.at>
Date: Tue, 23 Jun 2026 19:27:55 +0200
fix use of uninitialized volume in OSS mixer
if no "vol" device exists in the mixer, v was used uninitialized.
return early on match and return NULL with a warning otherwise.
Diffstat:
M components/volume.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
DIR diff --git a/components/volume.c b/components/volume.c
@@ -211,11 +211,14 @@
close(afd);
return NULL;
}
+ close(afd);
+ return bprintf("%d", v & 0xff);
}
}
close(afd);
+ warn("vol_perc: no 'vol' mixer device");
- return bprintf("%d", v & 0xff);
+ return NULL;
}
#endif