fix(p6-batch): reject clean EOF on record read; add traversal/EOF security tests

This commit is contained in:
2026-09-10 22:05:18 +02:00
parent c026176bb3
commit fc2d144492
4 changed files with 75 additions and 3 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ int batch_read_apply(int fd, const Config* config, const char* dest_root) {
log_message(LOG_LEVEL_ERROR, "batch: could not allocate a %llu-byte record", length);
return -1;
}
if (!read_exact(fd, record, (size_t)length, &eof)) {
if (!read_exact(fd, record, (size_t)length, &eof) || eof) {
log_message(LOG_LEVEL_ERROR, "batch: truncated chunk record");
free(record);
return -1;