diff options
author | Omar Polo <op@omarpolo.com> | 2021-03-03 17:51:30 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-03-03 17:51:30 +0000 |
commit | de62c38d81239d09db425974b3197c32d0fad51b (patch) | |
tree | eb39f36f50912956d76368f5c42ea9c534fe61dd /log.c | |
parent | 2c3e53dac6faed4d9502bd3310b4837f0d3112cf (diff) |
fix out-of-bounds access
obviously msg[datalen] is an off-by-one
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |