diff options
author | brian <brian@cvs.openbsd.org> | 2001-07-07 13:12:58 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 2001-07-07 13:12:58 +0000 |
commit | f450dee1afdaa407e9eb35b9d02efd9642a245fa (patch) | |
tree | fc6b08c364ceec9088ca77209da968c852581dc9 /usr.sbin | |
parent | 77c141e085069b216fedb9fe8e22e070ab8ccea4 (diff) |
Don't try to dereference the -1th ccp algorithm array entry when we
open CCP with no algorithm.
Diffstat (limited to 'usr.sbin')
-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; |