From ca513ebf096209e48e356bf479321126035e202a Mon Sep 17 00:00:00 2001
From: Niklas Hallqvist <niklas@cvs.openbsd.org>
Date: Tue, 13 Oct 1998 06:49:47 +0000
Subject: Remove NULL deref condition

---
 sys/netinet/ip_ipsp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index 3d1e940947a..31700ec9c8c 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: ip_ipsp.c,v 1.26 1998/05/18 21:10:57 provos Exp $	*/
+/*	$OpenBSD: ip_ipsp.c,v 1.27 1998/10/13 06:49:46 niklas Exp $	*/
 
 /*
  * The authors of this code are John Ioannidis (ji@tla.org),
@@ -378,7 +378,7 @@ cleanup_expirations(struct in_addr dst, u_int32_t spi, u_int8_t sproto)
 {
     struct expiration *exp, *nexp;
     
-    for (exp = explist; exp; exp = exp->exp_next)
+    for (exp = explist; exp; exp = exp ? exp->exp_next : explist)
       if ((exp->exp_dst.s_addr == dst.s_addr) &&
 	  (exp->exp_spi == spi) && (exp->exp_sproto == sproto))
       {
-- 
cgit v1.2.3