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:
040fecc
)
service: make sure string read is null terminated
author
Daniel Golle
<daniel@makrotopia.org>
Sun, 15 Aug 2021 11:34:05 +0000
(12:34 +0100)
committer
Daniel Golle
<daniel@makrotopia.org>
Sun, 15 Aug 2021 14:16:23 +0000
(15:16 +0100)
Coverity CID:
1490007
String not null terminated
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
service/service.c
patch
|
blob
|
history
diff --git
a/service/service.c
b/service/service.c
index b3286dc9b2235f0b7f8dff46341e12837e65ad5a..419f96cdf422447f06893148c0cddc50a80d52cc 100644
(file)
--- a/
service/service.c
+++ b/
service/service.c
@@
-324,6
+324,9
@@
static void put_cgroups(struct blob_buf *b)
return;
ret = read(fd, &buf, sizeof(buf));
+ /* make sure buffer is NULL-terminated */
+ buf[sizeof(buf)-1] = '\0';
+
close(fd);
if (ret < 2)