From 813b934a8a60c6eb1b54365ef190f3583e7dc8ce Mon Sep 17 00:00:00 2001 From: mpi Date: Tue, 9 Jul 2024 16:08:30 +0000 Subject: [PATCH] Read the whole buffer, not its size minus one. From Christian Ludwig cludwig at genua.de. --- usr.sbin/btrace/btrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/btrace/btrace.c b/usr.sbin/btrace/btrace.c index a66949cda87..aa75a12f676 100644 --- a/usr.sbin/btrace/btrace.c +++ b/usr.sbin/btrace/btrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: btrace.c,v 1.91 2024/05/21 05:00:48 jsg Exp $ */ +/* $OpenBSD: btrace.c,v 1.92 2024/07/09 16:08:30 mpi Exp $ */ /* * Copyright (c) 2019 - 2023 Martin Pieuchot @@ -421,7 +421,7 @@ rules_do(int fd) ssize_t rlen; size_t i; - rlen = read(fd, devtbuf, sizeof(devtbuf) - 1); + rlen = read(fd, devtbuf, sizeof(devtbuf)); if (rlen == -1) { if (errno == EINTR && quit_pending) { printf("\n"); -- 2.20.1