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
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@perillo
Copy link
Contributor

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 added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 13, 2020
@cagedmantis cagedmantis modified the milestones: Unreleased, Backlog Jan 13, 2020
@cagedmantis
Copy link
Contributor

/cc @mikioh @ianlancetaylor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants