diff options
author | 2000-04-25 13:39:02 +0000 | |
---|---|---|
committer | 2000-04-25 13:39:02 +0000 | |
commit | bbd80cf808e719a301bc654872be590708dc4ca8 (patch) | |
tree | 346b7a56538a7917c8c210193a372e7c22de7a3d /lib/libc | |
parent | getpw*_r() (diff) | |
download | wireguard-openbsd-bbd80cf808e719a301bc654872be590708dc4ca8.tar.xz wireguard-openbsd-bbd80cf808e719a301bc654872be590708dc4ca8.zip |
correct boundary check. XXX should avoid code duplicate here...
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/getaddrinfo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 8de6394a10e..960d7d3584c 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getaddrinfo.c,v 1.17 2000/03/16 14:08:55 itojun Exp $ */ +/* $OpenBSD: getaddrinfo.c,v 1.18 2000/04/25 13:39:02 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -1767,7 +1767,7 @@ res_querydomainN(name, domain, target) h_errno = NO_RECOVERY; return (-1); } - if (n-- != 0 && name[n] == '.') { + if (n > 0 && name[--n] == '.') { strncpy(nbuf, name, n); nbuf[n] = '\0'; } else |