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

x/net/ipv4: missing error handling in the Header.Marshal method #36525

Open
perillo opened this issue Jan 13, 2020 · 1 comment
Open

x/net/ipv4: missing error handling in the Header.Marshal method #36525

perillo opened this issue Jan 13, 2020 · 1 comment
Milestone

Comments

@perillo
Copy link

@perillo perillo commented Jan 13, 2020

In the ipv4.Header.Marshal method, the code does not handle the possible error returned by h.Src.To4(). On the other hand, the possible error returned by h.Dst.To4() is handled correctly.

Another small issue is that the slice returned by To4() is still sliced (ip[:net.IPv4len]); this is unnecessary.

See https://github.com/golang/net/blob/master/ipv4/header.go#L92

@gopherbot gopherbot added this to the Unreleased milestone Jan 13, 2020
@cagedmantis cagedmantis modified the milestones: Unreleased, Backlog Jan 13, 2020
@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Jan 13, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.