Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: skipped error check #50946

Closed
komkom opened this issue Feb 1, 2022 · 2 comments
Closed

net: skipped error check #50946

komkom opened this issue Feb 1, 2022 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@komkom
Copy link
Contributor

komkom commented Feb 1, 2022

What version of Go are you using (go version)?

$ go version

master

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env linux
$ go env

What did you do?

Checked the go source with a linter

What did you expect to see?

What did you see instead?

In the file net/dnsclient_unix.go in the function newRequest error handling is missing after calling b.Finish(). If the implementation of dnsmessage.Builder.Finish changes it is theoretically possible that the missing error handling introduces a nil pointer exception.

komkom added a commit to komkom/go that referenced this issue Feb 1, 2022
In the file net/dnsclient_unix.go in the function newRequest
error handling is missing after calling b.Finish(). If
the implementation of dnsmessage.Builder.Finish changes
it is theoretically possible that the missing error handling
introduces a nil pointer exception.

Fixes golang#50946
@gopherbot
Copy link

Change https://golang.org/cl/381966 mentions this issue: net: improve error handling in dnsclient_unix.go

@seankhliao seankhliao changed the title affected/package: net net: skipped error check Feb 1, 2022
@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 1, 2022
@ianlancetaylor
Copy link
Contributor

Thanks. It's not necessary to open an issue for a simple code fix if you are going to send the fix anyhow. It's OK to just send the fix. Thanks for doing this.

@golang golang locked and limited conversation to collaborators May 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants