From 65246e30de91e554adf2b0b1b37394597374f08c Mon Sep 17 00:00:00 2001 From: yasuoka Date: Sat, 13 Jul 2024 14:28:27 +0000 Subject: [PATCH] NULL check must be inside the loop. found tobhe ok tobhe --- sbin/iked/radius.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/iked/radius.c b/sbin/iked/radius.c index 8cd4a5310e1..ab2e6fb1ed6 100644 --- a/sbin/iked/radius.c +++ b/sbin/iked/radius.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radius.c,v 1.6 2024/07/13 14:19:09 yasuoka Exp $ */ +/* $OpenBSD: radius.c,v 1.7 2024/07/13 14:28:27 yasuoka Exp $ */ /* * Copyright (c) 2024 Internet Initiative Japan Inc. @@ -892,9 +892,9 @@ iked_radius_dae_on_event(int fd, short ev, void *ctx) } } else if (radius_get_uint32_attr(req, RADIUS_TYPE_FRAMED_IP_ADDRESS, &u32) == 0) { - addr4 = sa->sa_addrpool; - if (addr4 != NULL) { - RB_FOREACH(sa, iked_sas, &env->sc_sas) { + RB_FOREACH(sa, iked_sas, &env->sc_sas) { + addr4 = sa->sa_addrpool; + if (addr4 != NULL) { if (u32 == ((struct sockaddr_in *)&addr4->addr) ->sin_addr.s_addr) { ikev2_ike_sa_setreason(sa, reason); -- 2.20.1