bios/boot: Fix memcpy exceeding length (Thanks @acathla).

This commit is contained in:
Florent Kermarrec 2021-11-09 14:04:40 +01:00
parent 7b259888bb
commit 02c0ed2de7

View file

@ -260,7 +260,7 @@ int serialboot(void)
/* Copy payload */
load_addr = (char *)(uintptr_t) get_uint32(&frame.payload[0]);
memcpy(load_addr, &frame.payload[4], frame.payload_length);
memcpy(load_addr, &frame.payload[4], frame.payload_length - 4);
/* Acknowledge and continue */
uart_write(SFL_ACK_SUCCESS);