From: Razvan Cojocaru <[email protected]>
dco_new_peer() and dco_get_peer() passed the result straight to
nla_nest_start() without checking for NULL. Return -ENOMEM like the
other callers.
dco_new_peer() unchecked since e34437c2 ("dco: introduce low-level code
for handling ovpn-dco in the Linux kernel"), dco_get_peer() since
5a8fb55a ("dco-linux: implement dco_get_peer_stats{, multi} API").
Change-Id: Idb3c52174e588016240e9c9162a1676e1531c551
Signed-off-by: Razvan Cojocaru <[email protected]>
Acked-by: Antonio Quartulli <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2101
---
This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2101
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Antonio Quartulli <[email protected]>
diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c
index 4412ad0..50d4c54 100644
--- a/src/openvpn/dco_linux.c
+++ b/src/openvpn/dco_linux.c
@@ -234,6 +234,12 @@
msg(D_DCO_DEBUG, "%s: peer-id %u, fd %d, remote addr: %s", __func__,
peerid, sd, remotestr);
struct nl_msg *nl_msg = ovpn_dco_nlmsg_create(dco, OVPN_CMD_PEER_NEW);
+ if (!nl_msg)
+ {
+ gc_free(&gc);
+ return -ENOMEM;
+ }
+
struct nlattr *attr = nla_nest_start(nl_msg, OVPN_A_PEER);
int ret = -EMSGSIZE;
@@ -1229,6 +1235,11 @@
msg(D_DCO_DEBUG | M_NOIPREFIX, "%s: peer-id %d", __func__, peer_id);
struct nl_msg *nl_msg = ovpn_dco_nlmsg_create(dco, OVPN_CMD_PEER_GET);
+ if (!nl_msg)
+ {
+ return -ENOMEM;
+ }
+
struct nlattr *attr = nla_nest_start(nl_msg, OVPN_A_PEER);
int ret = -EMSGSIZE;
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel