Skip to content

Commit e68bdbe

Browse files
committed
fix(action): drop len+1 capacity hint flagged by CodeQL
CodeQL's go/allocation-size-overflow rule flagged the len(hooks)+1 capacity hint as a potential integer overflow in allocation size. In practice the hooks slice is tiny, but the hint is unnecessary because append handles growth, so drop the +1 to clear the alert.
1 parent 338ce4c commit e68bdbe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/resources/action/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ func (r *ActionResource) Create(ctx context.Context, req resource.CreateRequest,
646646

647647
// Append the new hook to existing hooks and replace the entire array
648648
// This handles the case where the hooks array might not exist
649-
newHooks := make([]interface{}, 0, len(hooks)+1)
649+
newHooks := make([]interface{}, 0, len(hooks))
650650
for _, h := range hooks {
651651
newHooks = append(newHooks, h)
652652
}

0 commit comments

Comments
 (0)