Reject oversized EEPROM read commands (Thanks @BB-KING777)

This commit is contained in:
Armel FAUVEAU committed 2026-08-24 02:46:58 +02:00
1 parent 88d17655de
commit 265f83a447
1 file changed
+4
+4
View File
@@ -403,6 +403,10 @@ static void CMD_051B(uint32_t Port, const uint8_t *pBuffer)
gFmRadioCountdown_500ms = fm_radio_countdown_500ms; gFmRadioCountdown_500ms = fm_radio_countdown_500ms;
#endif #endif
// Reject reads that do not fit in the fixed-size reply buffer.
if (pCmd->Size > sizeof(Reply.Data.Data))
return;
memset(&Reply, 0, sizeof(Reply)); memset(&Reply, 0, sizeof(Reply));
Reply.Header.ID = 0x051C; Reply.Header.ID = 0x051C;
Reply.Header.Size = pCmd->Size + 4; Reply.Header.Size = pCmd->Size + 4;