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: "runtime error: slice bounds out of range" parsing resolv.conf with unknown eight character options #8252

Closed
calmh opened this issue Jun 20, 2014 · 7 comments

Comments

@calmh
Copy link
Contributor

calmh commented Jun 20, 2014

go version go1.3 darwin/amd64

There's an off by one difference between check and slice index in dnsconfig_unix.go that
causes a crash if there are unrecognized eight character options in /etc/resolv.conf. An
example resolv.conf that triggers this is:

options timeout 2
options attempts 1
search internal
nameserver 10.60.60.151
nameserver 10.60.60.254

(the "options attempts 1" line)

It's possible this is an invalid resolv.conf; we won't be able to parse the options but
should anyway not crash.
@calmh
Copy link
Contributor Author

calmh commented Jun 20, 2014

Comment 1:

https://golang.org/cl/102470046 contains a test and fix

@ianlancetaylor
Copy link
Contributor

Comment 2:

Labels changed: added repo-main, release-go1.3.1.

@gopherbot
Copy link

Comment 3:

CL https://golang.org/cl/102470046 mentions this issue.

@adg
Copy link
Contributor

adg commented Jul 15, 2014

Comment 4:

This issue was closed by revision 0a5cb7d.

Status changed to Fixed.

@rsc
Copy link
Contributor

rsc commented Aug 11, 2014

Comment 5:

Trivial change for problem without workaround.
Approved for Go 1.3.1.

@adg
Copy link
Contributor

adg commented Aug 11, 2014

Comment 6:

This issue was closed by revision 16ce5710133e.

@adg
Copy link
Contributor

adg commented Aug 11, 2014

Comment 7:

Applied to release-branch.go1.3.

@rsc rsc added this to the Go1.3.1 milestone Apr 14, 2015
adg added a commit that referenced this issue May 11, 2015
…ng resolv.conf options.

««« CL 102470046 / 5207b394de96
net: Don't read beyond end of slice when parsing resolv.conf options.

Fixes #8252.

LGTM=adg
R=ruiu, josharian, adg
CC=golang-codereviews
https://golang.org/cl/102470046

»»»

TBR=rsc
CC=golang-codereviews
https://golang.org/cl/124140043
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants