Nil dereference panic fix#361
Closed
artemseleznev wants to merge 2 commits intogo-openapi:masterfrom
Closed
Conversation
Signed-off-by: Artem Seleznev <seleznyov.artyom@gmail.com>
Author
|
@fredbi thank you. Some unit tests failed with 404 resp code. Seems it's not caused by our fix. Can we re-run them? |
Member
|
Yeah tried this already. It is unrelated to your PR. I have to check first for some flaky tests. I'll take care of your PR don't worry |
Member
|
been a little too quick yesterday. The actual check should be if c.spec != nil. Fixing it in another PR, on top of your commit (so your contribution remains recorded :) ) |
Member
|
superseded by #363, which onboards this commit. Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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