antrea-io / libOpenflow

OpenFlow Go library
Apache License 2.0
9 stars 18 forks source link

Allocate 6 bytes to copy MAC addresses when unmarshalling ethernet ma… #46

Closed shi0rik0 closed 8 months ago

shi0rik0 commented 1 year ago

…tch fields

Currently we are trying to unmarshal data to an uninitialized struct whose net.HardwareAddr fields are set to nil. In this case the copy() function silently does nothing.

Initialize the fields to slices of bytes of length 6 before copying data to them.

This commit is derived from #30.