projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96d8bf2
)
initd: fix off-by-one error in mkdev.c
author
Daniel Golle
<daniel@makrotopia.org>
Mon, 30 Aug 2021 21:20:30 +0000
(22:20 +0100)
committer
Daniel Golle
<daniel@makrotopia.org>
Mon, 30 Aug 2021 21:22:16 +0000
(22:22 +0100)
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>
initd/mkdev.c
patch
|
blob
|
history
diff --git
a/initd/mkdev.c
b/initd/mkdev.c
index 44101aa12df5e5a102b626d2eb41f1a10a40e2ad..1c9c97ab8e0560e11fd5c56efc2d09c2244aae9d 100644
(file)
--- 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;