diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2006-01-19 06:40:17 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2006-01-19 06:40:17 +0000 |
commit | 20e7f08ac5e4b04d5c50cf3558ab2690f541d8cd (patch) | |
tree | fe78730217f63cbc9f9858fd8c59550ff43c18c4 /usr.sbin | |
parent | 3b8feb1ff237911f1f85a7a24365a7737a0ea1d7 (diff) |
Check SA_LEN(sa) after sa is checked for NULL. Pointed out by solar at
openwall.com, ok henning@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ntpd/server.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ntpd/server.c b/usr.sbin/ntpd/server.c index 0096aa07606..8a01489499c 100644 --- a/usr.sbin/ntpd/server.c +++ b/usr.sbin/ntpd/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.26 2005/09/24 00:32:03 dtucker Exp $ */ +/* $OpenBSD: server.c,v 1.27 2006/01/19 06:40:16 dtucker Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -44,12 +44,12 @@ setup_listeners(struct servent *se, struct ntpd_conf *conf, u_int *cnt) for (ifap = ifa; ifap != NULL; ifap = ifap->ifa_next) { sa = ifap->ifa_addr; - if (SA_LEN(sa) == 0) - continue; if (sa == NULL || (sa->sa_family != AF_INET && sa->sa_family != AF_INET6)) continue; + if (SA_LEN(sa) == 0) + continue; if ((la = calloc(1, sizeof(struct listen_addr))) == NULL) |