Browse Source

return -1 on host() address parsing failure, not 1.

Match what parse.y expects it to return.
ok millert@
OPENBSD_5_7
bcook 10 years ago
parent
commit
e32816bab7
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      src/usr.sbin/ntpd/client.c
  2. +2
    -2
      src/usr.sbin/ntpd/config.c

+ 2
- 2
src/usr.sbin/ntpd/client.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: client.c,v 1.96 2015/01/09 07:35:37 deraadt Exp $ */
/* $OpenBSD: client.c,v 1.97 2015/01/09 23:44:07 bcook Exp $ */
/* /*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -112,7 +112,7 @@ client_nextaddr(struct ntp_peer *p)
return (-1); return (-1);
} }
if ((p->addr = p->addr->next) == NULL)
if (p->addr == NULL || (p->addr = p->addr->next) == NULL)
p->addr = p->addr_head.a; p->addr = p->addr_head.a;
p->shift = 0; p->shift = 0;


+ 2
- 2
src/usr.sbin/ntpd/config.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: config.c,v 1.19 2006/05/27 17:01:07 henning Exp $ */
/* $OpenBSD: config.c,v 1.20 2015/01/09 23:48:21 bcook Exp $ */
/* /*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -58,7 +58,7 @@ host(const char *s, struct ntp_addr **hn)
*hn = h; *hn = h;
return (1);
return (-1);
} }
struct ntp_addr * struct ntp_addr *


Loading…
Cancel
Save