Skip to content

Commit

Permalink
Fix slice out of range access
Browse files Browse the repository at this point in the history
  • Loading branch information
alexliesenfeld committed Oct 17, 2023
1 parent 5b1d207 commit 410b9f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions check.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ func executeCheck(
// These slices are being passed to this library as configuration parameters, so we don't know how they
// are being used otherwise in the users program.
interceptors := make([]Interceptor, 0, len(cfg.interceptors)+len(check.Interceptors))
copy(interceptors, cfg.interceptors)
copy(interceptors[len(cfg.interceptors):], cfg.interceptors)
interceptors = append(interceptors, cfg.interceptors...)
interceptors = append(interceptors, check.Interceptors...)

newState = withInterceptors(interceptors, func(ctx context.Context, _ string, state CheckState) CheckState {
checkFuncResult := executeCheckFunc(ctx, check)
Expand Down

0 comments on commit 410b9f7

Please sign in to comment.