Validate Audita report bounds with constant memory

This commit is contained in:
2026-11-27 21:21:22 +00:00
parent aa0c1f1c03
commit 89f5a6a0ad
5 changed files with 76 additions and 5 deletions

View File

@@ -112,7 +112,7 @@ func (polishStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (*St
if err := requireRegularReadableFile(path, "audita report"); err != nil {
return nil, fmt.Errorf("polish: %w", err)
}
if _, err := fileops.ReadFileBounded(path, audita.MaxReportOutputBytes); err != nil {
if err := fileops.CheckFileBounded(path, audita.MaxReportOutputBytes); err != nil {
return nil, fmt.Errorf("polish: read audita report %q: %w", path, err)
}
reportPaths = append(reportPaths, path)