[PATCH applied] Re: socket: assert buffer length before reading prepended sockaddr family

Gert Doering <[email protected]>
Newsgroups gmane.network.openvpn.devel
Message-ID <[email protected]>
As discussed, we keep the ASSERT() on "too short buffer" (because it would
be a breach of contract between *our* driver in the kernel) - but it gets
moved so even in that case we avoid the "access out of buffer memory first,
ASSERT() then" situation.

Also, code cleanup :-) - no real change, just move the common parts after
the switch().

Stared-at-code, test compiled on ubuntu/mingw.  Build errors in buildbot
are unrelated "infrastructure" issues (as the unix code paths are fully
untouched by this patch).

Your patch has been applied to the master and release/2.7 branch (bugfix),
code is not in 2.6 or earlier.

commit 71b271d9a168b7c43f3b78bdc4768edadfa25e86 (master)
commit d849dbd395fff72ffc10e0161e5a4237f72f5be3 (release/2.7)
Author: Lev Stipakov
Date:   Fri Jun 5 16:18:02 2026 +0200

     socket: assert buffer length before reading prepended sockaddr family

     Signed-off-by: Lev Stipakov <[email protected]>
     Acked-by: Gert Doering <[email protected]>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1706
     Message-Id: <[email protected]>
     URL: https://www.mail-archive.com/[email protected]/msg37065.html
     Signed-off-by: Gert Doering <[email protected]>


--
kind regards,

Gert Doering
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.