Avoid the following repeated computing or replay attack.

This commit is contained in:
airskywater 2022-10-09 18:29:13 +08:00 committed by GitHub
parent df7a26c28c
commit 6d9da043da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,7 +175,7 @@ int main()
case FW_CMD_LOAD_APP_DATA:
puts("request: load-app-data\n");
if (hdr.len != 128 || *app_size == 0) {
if (hdr.len != 128 || *app_size == 0 || left == 0) {
// Bad length of this command or bad app size -
// they need to call FW_CMD_LOAD_APP_SIZE first
rsp[0] = STATUS_BAD;