aboutsummaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-03-03 17:51:30 +0000
committerOmar Polo <op@omarpolo.com>2021-03-03 17:51:30 +0000
commitde62c38d81239d09db425974b3197c32d0fad51b (patch)
treeeb39f36f50912956d76368f5c42ea9c534fe61dd /log.c
parent2c3e53dac6faed4d9502bd3310b4837f0d3112cf (diff)
fix out-of-bounds access
obviously msg[datalen] is an off-by-one
Diffstat (limited to 'log.c')
-rw-r--r--log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/log.c b/log.c
index 19b72b9..767d823 100644
--- a/log.c
+++ b/log.c
@@ -252,7 +252,7 @@ handle_log(int fd, short ev, void *d)
datalen = imsg.hdr.len - IMSG_HEADER_SIZE;
msg = imsg.data;
- msg[datalen] = '\0';
+ msg[datalen-1] = '\0';
/* ignore imsg.hdr.type for now */
if (conf.foreground)