fix out-of-bounds access

obviously msg[datalen] is an off-by-one
This commit is contained in:
Omar Polo 2021-03-03 17:51:30 +00:00
parent 2c3e53dac6
commit de62c38d81
1 changed files with 1 additions and 1 deletions

2
log.c
View File

@ -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)