From a177913bd63c24fc90e82f22538b2004e9d7c685 Mon Sep 17 00:00:00 2001 From: icex2 Date: Tue, 28 Nov 2023 15:29:32 +0100 Subject: [PATCH] fix(p3io): Off-by-one error on assert Buffers are allowed to have the exact size as the max defined P3IO buffer size. Cutting it short by one byte causes this to fail incorrectly when using the pure raw buffer structure --- src/main/p3io/cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/p3io/cmd.c b/src/main/p3io/cmd.c index bfb4e82..78c8b02 100644 --- a/src/main/p3io/cmd.c +++ b/src/main/p3io/cmd.c @@ -41,7 +41,7 @@ void p3io_resp_hdr_init( { log_assert(resp_hdr != NULL); log_assert(req_hdr != NULL); - log_assert(nbytes < P3IO_MAX_MESSAGE_SIZE); + log_assert(nbytes <= P3IO_MAX_MESSAGE_SIZE); /* Length byte in this packet format counts everything from the length byte onwards. The length byte itself occurs at the start of the frame. */