]> git.ipfire.org Git - thirdparty/openvpn.git/commit
solaris/open_tun: prevent crash when dev is empty string
authorAntonio Quartulli <a@unstable.cc>
Sat, 17 Sep 2022 12:58:11 +0000 (14:58 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 23 Sep 2022 16:08:44 +0000 (18:08 +0200)
commitcec4353b60bc74a2d8d78ca6b8b6f9fae02e92eb
tree304d41d3a42b6a2599c55b8b0718fff84789c3e7
parentcac18de7a1245918431d1677618a2f50dc79643f
solaris/open_tun: prevent crash when dev is empty string

This was originally reported on GH, but never dealt with.
Make sure 'ptr' is always initialized to prevent derefence of null
pointer in case of empty dev string.

While at it, change the if condition to use ptr instead of dev, since
dev is not used anymore in the logic.

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220917125811.13549-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25235.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/tun.c