summaryrefslogtreecommitdiff
path: root/initd
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2021-08-30 22:20:30 +0100
committerDaniel Golle <daniel@makrotopia.org>2021-08-30 22:22:16 +0100
commit8eb1d783cca6e0d501dd3a2f94262ffc36ae6482 (patch)
tree61a42502c5ceb2c3a0ae363a2b77b3e4259b7201 /initd
parent96d8bf2c7b6773636efb8b175993e5d17ff7d0bf (diff)
downloadprocd-8eb1d783cca6e0d501dd3a2f94262ffc36ae6482.tar.gz
initd: fix off-by-one error in mkdev.c
Actually make sure buffer is 0-terminated intead of writing the 0-byte out of bounds. Coverity CID: 1330087 Readlink used insecurely Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'initd')
-rw-r--r--initd/mkdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/initd/mkdev.c b/initd/mkdev.c
index 44101aa..1c9c97a 100644
--- a/initd/mkdev.c
+++ b/initd/mkdev.c
@@ -86,7 +86,7 @@ static void find_devs(bool block)
if (len <= 0)
continue;
- buf[len] = 0;
+ buf[sizeof(buf) - 1] = '\0';
if (!find_pattern(buf))
continue;