Read the whole buffer, not its size minus one.
authormpi <mpi@openbsd.org>
Tue, 9 Jul 2024 16:08:30 +0000 (16:08 +0000)
committermpi <mpi@openbsd.org>
Tue, 9 Jul 2024 16:08:30 +0000 (16:08 +0000)
From Christian Ludwig cludwig at genua.de.

usr.sbin/btrace/btrace.c

index a66949c..aa75a12 100644 (file)
@@ -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 <mpi@openbsd.org>
@@ -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");