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

(cherry picked from commit 969be39fb3caf4272f128dbf3267ceba5966a6ce)

Details

Provenance
arichardsonAuthored on Sep 15 2025, 10:08 PM
dimCommitted on May 27 2026, 9:41 PM
Reviewer
kp
Differential Revision
D52543: if_ovpn.c: fix use of uninitialized variable
Parents
rG2349f5a91587: ipfilter: Fix NULL dereferences in ipf_checkicmp6matchingstate()
Branches
Unknown
Tags
Unknown