Skip to content

Nil dereference panic fix#90

Merged
fredbi merged 2 commits intogo-openapi:masterfrom
Infowatch:master
Sep 10, 2025
Merged

Nil dereference panic fix#90
fredbi merged 2 commits intogo-openapi:masterfrom
Infowatch:master

Conversation

@artemseleznev
Copy link
Copy Markdown

The Svace static analyzer (https://www.ispras.ru/en/technologies/svace/) flagged this code as suspicious: it could lead to a panic (nil pointer dereference) because spec might be nil.
We have not spec != nil checks in all callers, so this check'd prevent panics

Artem Seleznev and others added 2 commits September 9, 2025 09:18
Signed-off-by: Artem Seleznev <seleznyov.artyom@gmail.com>
@artemseleznev artemseleznev marked this pull request as ready for review September 9, 2025 06:24
Copy link
Copy Markdown
Member

@fredbi fredbi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok thanks

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 10, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.04%. Comparing base (f09028f) to head (1644bd9).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
spec.go 0.00% 2 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #90      +/-   ##
==========================================
- Coverage   76.92%   76.04%   -0.88%     
==========================================
  Files           4        4              
  Lines         260      263       +3     
==========================================
  Hits          200      200              
- Misses         45       47       +2     
- Partials       15       16       +1     
Flag Coverage Δ
oldstable-macos-latest 76.04% <0.00%> (-0.88%) ⬇️
oldstable-ubuntu-latest 76.04% <0.00%> (-0.88%) ⬇️
oldstable-windows-latest 76.04% <0.00%> (-0.88%) ⬇️
stable-macos-latest 76.04% <0.00%> (-0.88%) ⬇️
stable-ubuntu-latest 76.04% <0.00%> (-0.88%) ⬇️
stable-windows-latest 76.04% <0.00%> (-0.88%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fredbi fredbi merged commit f0a66c8 into go-openapi:master Sep 10, 2025
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants