From acc6cd4aab0a98d090a5f239cee56c206a9be496 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Sat, 18 Mar 2023 17:34:07 +1100 Subject: [PATCH] chat: Fix loop condition to avoid possible 1-byte buffer overrun Signed-off-by: Paul Mackerras --- chat/chat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat/chat.c b/chat/chat.c index fa67fd2..336c0f4 100644 --- a/chat/chat.c +++ b/chat/chat.c @@ -609,7 +609,7 @@ void terminate(int status) int c, rep_len; rep_len = strlen(report_buffer); - while (rep_len + 1 <= sizeof(report_buffer)) { + while (rep_len + 1 < sizeof(report_buffer)) { alarm(1); c = get_char(); alarm(0); -- 2.39.2