diff --git a/litex/soc/software/bios/boot.c b/litex/soc/software/bios/boot.c index 8560c0fe8..7a7b3b76f 100644 --- a/litex/soc/software/bios/boot.c +++ b/litex/soc/software/bios/boot.c @@ -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);