HomeFreeBSD

if_ovpn.c: fix use of uninitialized variable

Description

if_ovpn.c: fix use of uninitialized variable

In case we use OVPN_CIPHER_ALG_NONE, the memcpy will attempt to copy 0
bytes from an uninitialized pointer. While the memcpy() implementation
will treat this as a no-op and not actually dereferece the undefined
variable it is still undefined behaviour to the compiler and should be
fixed. Found by building with clang HEAD

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D52543

Details

Provenance
arichardsonAuthored on Sep 15 2025, 10:08 PM
Reviewer
kp
Differential Revision
D52543: if_ovpn.c: fix use of uninitialized variable
Parents
rG90234b9dd8cb: riscv: Provide prototypes for fpgetmask/fpsetmask
Branches
Unknown
Tags
Unknown