HomeFreeBSD

netlink: do not memcpy 0 bytes from a NULL pointer

Description

netlink: do not memcpy 0 bytes from a NULL pointer

Although it works in practice it is UB, and might break after a future
compiler update.

This was rewritten in main and the memcpy call no longer exists, so this
is a direct commit to stable/13 before 055776c84a41 is MFC'd.

Discussed with: melifaro
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38927

(cherry picked from commit 305aaa93e0c805294c8bcbb5fe8b9f7caa28b349)

Details

Provenance
emasteAuthored on Mar 6 2023, 4:30 PM
Differential Revision
D38927: netlink: do not memcpy 0 bytes from a NULL pointer
Parents
rG6f68483d3f72: netlink: simplify temporary address allocation in rtnl_handle_getlink().
Branches
Unknown
Tags
Unknown