CVE-2025-25204: Go Nil Error Return On Empty Check
Returning an unassigned `err` variable inside an empty collection or nil check (`len(x) == 0` or `x == nil`) often results in inadvertently returning `nil` when a failure was intended. Ensure that you explicitly create and return a new error using `fmt.Errorf` or `errors.New` if this logic path represents a failure state.
greprules fetch cve-2025-25204-go-nil-error-return-on-empty-check --engine opengrepDescription
Returning an unassigned `err` variable inside an empty collection or nil check (`len(x) == 0` or `x == nil`) often results in inadvertently returning `nil` when a failure was intended. Ensure that you explicitly create and return a new error using `fmt.Errorf` or `errors.New` if this logic path represents a failure state.
Community feedback
0 rule-level signals from signed-in users.
- Useful reports
- 0
- Context false positives
- 0
- Metadata suggestions
- 0
Contextual precision
Aggregated from approved scan feedback. False-positive reports describe observed scan contexts, not a global rule verdict.
- Findings observed
- 0
- Projects
- 0
- Reporters
- 0
Precision details are collecting more signed-in reports before verdict counts or ratios are emphasized.
No approved finding verdicts yet.
No scan diagnostics reported yet.