diff options
author | 2001-07-07 13:12:57 +0000 | |
---|---|---|
committer | 2001-07-07 13:12:57 +0000 | |
commit | 2d5fb125dc50ae4492d14853a244bc7f45227e42 (patch) | |
tree | a2fe5b0f60c2be72cfc389604aceaedcdb548b5f | |
parent | On 2nd though, pci_conf_read returns host-ordered words. (diff) | |
download | wireguard-openbsd-2d5fb125dc50ae4492d14853a244bc7f45227e42.tar.xz wireguard-openbsd-2d5fb125dc50ae4492d14853a244bc7f45227e42.zip |
Don't try to dereference the -1th ccp algorithm array entry when we
open CCP with no algorithm.
-rw-r--r-- | usr.sbin/ppp/ppp/ccp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ppp/ppp/ccp.c b/usr.sbin/ppp/ppp/ccp.c index d8c8120ff9c..a5a6581dc35 100644 --- a/usr.sbin/ppp/ppp/ccp.c +++ b/usr.sbin/ppp/ppp/ccp.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: ccp.c,v 1.22 2001/07/07 03:08:49 brian Exp $ + * $OpenBSD: ccp.c,v 1.23 2001/07/07 13:12:57 brian Exp $ */ #include <sys/param.h> @@ -306,7 +306,7 @@ ccp_Required(struct ccp *ccp) int ccp_MTUOverhead(struct ccp *ccp) { - if (ccp->fsm.state == ST_OPENED) + if (ccp->fsm.state == ST_OPENED && ccp->out.algorithm >= 0) return algorithm[ccp->out.algorithm]->o.MTUOverhead; return 0; |