From fd1bbe8248d43b35a5bf4154064dc4791a53e1fa Mon Sep 17 00:00:00 2001 From: orbisai0security Date: Tue, 12 May 2026 14:34:30 +0000 Subject: [PATCH] fix: V-001 security vulnerability Automated security fix generated by Orbis Security AI --- firmware/asm/lcd-as-memframe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/firmware/asm/lcd-as-memframe.c b/firmware/asm/lcd-as-memframe.c index e952f4f7f05..7e352aea051 100644 --- a/firmware/asm/lcd-as-memframe.c +++ b/firmware/asm/lcd-as-memframe.c @@ -3,8 +3,10 @@ #include "lcd.h" void lcd_copy_buffer_rect(fb_data *dst, fb_data *src, int width, int height) { + if (width <= 0 || width > LCD_WIDTH || height <= 0) + return; do { - memcpy(dst, src, width * sizeof(fb_data)); + memcpy(dst, src, (size_t)width * sizeof(fb_data)); src += LCD_WIDTH; dst += LCD_WIDTH; } while (--height);