Merge pull request #568 from DrDoof/fix/upload-boundary-cr

httpd: re-check the byte that breaks a partial boundary match
This commit is contained in:
feelfree69 authored and GitHub committed 2026-10-25 16:52:47 +01:00
commit 5c6a82d50f
2 files changed
+117 -5

No files matched your search

+3 -3
View File
@@ -504,9 +504,10 @@ uint8_t stream_upload(void)
memcpy(flash_buf + write_len, boundary, bindex);
write_len += bindex;
bindex = 0;
} else {
crc16_bank1(upload_settings.p + upload_settings.bptr);
flash_buf[write_len++] = upload_settings.p[upload_settings.bptr++];
}
crc16_bank1(upload_settings.p + upload_settings.bptr);
flash_buf[write_len++] = upload_settings.p[upload_settings.bptr++];
if (write_len >= FLASH_PAGE_SIZE) {
/* The staged image spans FIRMWARE_UPLOAD_START to twice that,
* the span check_and_flash_update_image() reads back. Nothing
@@ -538,7 +539,6 @@ uint8_t stream_upload(void)
memcpy(flash_buf, flash_buf + FLASH_PAGE_SIZE, write_len);
}
}
bindex = 0;
}
} while(1);
}