From de62c38d81239d09db425974b3197c32d0fad51b Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Wed, 3 Mar 2021 17:51:30 +0000 Subject: fix out-of-bounds access obviously msg[datalen] is an off-by-one --- log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'log.c') 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) -- cgit v1.2.3