What changed, and why it matters
This commit removes a 100-character stack buffer and passes bootloader messages straight to the screen-drawing function. The old code used snprintf to copy the message into a fixed-size buffer, which could silently truncate very long strings. There is no direct evidence in the commit that this fixed a security vulnerability; it appears to be a cleanup or robustness improvement. The change does not introduce obvious new risks because the drawing function consumes the string immediately.
Treat as a minor hardening or code-quality change. Review whether any caller passes attacker-controlled or unbounded strings to _render_message, and consider adding length checks if such callers exist. No urgent action is indicated by the diff alone.
Security signals we found
Removal of fixed-size stack buffer in bootloader display path
Elimination of snprintf with potentially attacker-influenced format string argument
Bootloader code touched, which is a security-sensitive component
Evidence from the diff
In src/bootloader/bootloader.c, _render_message previously declared char print[100] and copied message into it with snprintf before calling UG_PutString. The patch removes the intermediate buffer and snprintf call, passing message directly to UG_PutString. UG_PutString is synchronous and draws into a screen buffer, so the string does not need to outlive the call. The old buffer could truncate messages longer than 100 bytes including terminator, but the commit message frames this only as ‘render messages directly,’ not as a security fix.
Changed components
src/bootloader/bootloader.cbootloader message rendering/displayInspect captured patch +1 / −3
diff --git a/src/bootloader/bootloader.c b/src/bootloader/bootloader.c
index 48d1019..3be4ff3 100644
--- a/src/bootloader/bootloader.c
+++ b/src/bootloader/bootloader.c
@@ -313,10 +313,8 @@ static void _load_progress_bar(float progress)
static void _render_message(const char* message, int duration)
{
- char print[100];
- snprintf(print, sizeof(print), "%s", message);
UG_ClearBuffer();
- UG_PutString(0, 0, print);
+ UG_PutString(0, 0, message);
UG_SendBuffer();
delay_ms(duration);
}
Why this scored 17/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.