From 18f97c820a43a1cb103e55b91ba4627e7426e850 Mon Sep 17 00:00:00 2001 From: daylily Date: Sat, 10 Jan 2026 01:25:37 +0800 Subject: [PATCH] Fix a panic when checking for magic number in firmware --- firmware/src/app.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/src/app.rs b/firmware/src/app.rs index 5641898..8e9abfa 100644 --- a/firmware/src/app.rs +++ b/firmware/src/app.rs @@ -215,8 +215,8 @@ impl App { { warn!( "App: SysEx does not start with magic number; first {} bytes = {}. dropping.", - MAGIC_NUMBER, - sysex[..MAGIC_NUMBER_LEN] + MAGIC_NUMBER_LEN.min(sysex.len()), + sysex[..MAGIC_NUMBER_LEN.min(sysex.len())] ); continue; }