diff options
author | 2007-02-18 19:03:11 +0000 | |
---|---|---|
committer | 2007-02-18 19:03:11 +0000 | |
commit | 0dd5d89d0c5d43f44eab20e3e7d96ff28db5a33f (patch) | |
tree | a7886609dcecb035830efb61c497a72c5f70ad85 /lib/libc | |
parent | Pass correct buffer size. (sizeof(cfgPtr->spare_names[c]) != 256) (diff) | |
download | wireguard-openbsd-0dd5d89d0c5d43f44eab20e3e7d96ff28db5a33f.tar.xz wireguard-openbsd-0dd5d89d0c5d43f44eab20e3e7d96ff28db5a33f.zip |
strlen(3) returns size_t.
OK itojun@.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/getaddrinfo.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index bf74bc9926f..21f2094bfdc 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getaddrinfo.c,v 1.60 2007/02/17 20:56:38 ray Exp $ */ +/* $OpenBSD: getaddrinfo.c,v 1.61 2007/02/18 19:03:11 ray Exp $ */ /* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */ /* @@ -1040,6 +1040,8 @@ getanswer(const querybuf *answer, int anslen, const char *qname, int qtype, } if ((qtype == T_A || qtype == T_AAAA || qtype == T_ANY) && type == T_CNAME) { + size_t len; + n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf); if ((n < 0) || !(*name_ok)(tbuf)) { had_error++; @@ -1047,14 +1049,14 @@ getanswer(const querybuf *answer, int anslen, const char *qname, int qtype, } cp += n; /* Get canonical name. */ - n = strlen(tbuf) + 1; /* for the \0 */ - if (n > ep - bp || n >= MAXHOSTNAMELEN) { + len = strlen(tbuf) + 1; /* for the \0 */ + if (len > ep - bp || len >= MAXHOSTNAMELEN) { had_error++; continue; } strlcpy(bp, tbuf, ep - bp); canonname = bp; - bp += n; + bp += len; continue; } if (qtype == T_ANY) { |