src/openvpn/dco_freebsd.c: handle malloc failure
PATCH v2 1/1 src/openvpn/dco_freebsd.c: handle malloc failure
malloc was not checked against NULL, I was able
to get core dump in case of failure
Signed-off-by Ilya Shipitsin <[email protected]...>
---
v2:
- style correction
src/openvpn/dco_freebsd.c | 4 ++++ 1 file changed, 4 insertions(+)
src/openvpn/dco_freebsd.c +4 -0
@@ -594,6 +594,10 @@ dco_available(int msglevel) } buf =malloc (ifcr.ifcr_total *IFNAMSIZ ); +if (!buf) + { + goto out; + } ifcr.ifcr_count = ifcr.ifcr_total; ifcr.ifcr_buffer = buf;
Signature · 1 line
2.35.3.windows.1
Acked-by Gert Doering <[email protected]...>
As discussed.
Tested with a basic client run on FreeBSD14 with DCO.
Your patch has been applied to the master and release/2.6 branch.
commit 5e79aed439d4e1b101c768aabfd695cd1c0a54ce (master) commit 73ce6ac984e3ab496f97979e41f2a27569a432fd (release/2.6)
Author: Ilya Shipitsin Date: Thu May 18 23:21:39 2023 +0200
src/openvpn/dco_freebsd.c: handle malloc failure
Signed-off-by: Ilya Shipitsin <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg26707.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering