diff options
| author | drkhsh <me@drkhsh.at> | 2026-06-23 19:27:55 +0200 |
|---|---|---|
| committer | drkhsh <me@drkhsh.at> | 2026-06-24 00:12:22 +0200 |
| commit | 60b28d8a78b14ecc43f1c7d177cfa5f8597e2071 (patch) | |
| tree | 5a5797248a74d91555539666913cd6ff89ad277a | |
| parent | 7a8545952ef647e6862c5b184aee0b13a48e741d (diff) | |
| download | slstatus-60b28d8a78b14ecc43f1c7d177cfa5f8597e2071.tar.gz | |
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.
| -rw-r--r-- | components/volume.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/components/volume.c b/components/volume.c index 5a2bfb7..20171da 100644 --- 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 |
