Skip to content

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

@perillo

Description

@perillo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions