if_ovpn: handle m_pullup() failure

Ensure we correctly handle m_pullup() failing in ovpn_finish_rx().

Reported by:	Coverity (CID 1490340)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost 2022-06-30 20:11:52 +02:00
parent 5fb35badc0
commit 6c77f8f0e0

View File

@ -1441,6 +1441,10 @@ ovpn_finish_rx(struct ovpn_softc *sc, struct mbuf *m,
/* Ensure we can read the first byte. */
m = m_pullup(m, 1);
if (m == NULL) {
OVPN_COUNTER_ADD(sc, nomem_data_pkts_in, 1);
return;
}
/*
* Check for address family, and disregard any control packets (e.g.