Validate Audita report bounds with constant memory
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user