From abb966713e5f4ad002e75749cfa567beaa05fd77 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Wed, 13 Apr 2022 17:46:37 -0400 Subject: [PATCH] canboot: fix typo Signed-off-by: Eric Callahan --- src/canboot_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/canboot_main.c b/src/canboot_main.c index c72982c..0188f6c 100644 --- a/src/canboot_main.c +++ b/src/canboot_main.c @@ -204,7 +204,7 @@ canboot_process_rx(uint32_t id, uint32_t len, uint8_t *data) // read into into the page buffer if (page_pos >= CONFIG_FLASH_PAGE_SIZE) return; - else if (page_pos > CONFIG_FLASH_PAGE_SIZE) + else if (page_pos + len > CONFIG_FLASH_PAGE_SIZE) len = CONFIG_FLASH_PAGE_SIZE - cmd_pos; memcpy(&page_buffer[page_pos], data, len); page_pos += len;