cnList double-closes file handle, masking close errors #32
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
mod-nag
mod-nag
mod-nag
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
nagonag
nagonag/ignore
question
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
heiko/cert-proxy#32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
cmd/cert-proxy-server/cnlist.gocloses the file twice:The explicit
cc.Close()at the return propagates errors correctly, but thedeferthen closes the already-closed handle a second time. The deferred close's error is suppressed by//nolint:errcheck, hiding any issue.Fix
Remove the
deferand keep only the explicitcc.Close()in the return, or vice versa.AI attribution comment added per repository instruction for this open issue.\n\n(co)authored by ai:gpt-5-codex