diff options
author | Szabolcs Nagy <nsz@port70.net> | 2014-06-06 19:20:07 +0200 |
---|---|---|
committer | Szabolcs Nagy <nsz@port70.net> | 2014-06-06 20:41:15 +0200 |
commit | 07355f503a9b0a3ab7a051e2931499a4c5898b15 (patch) | |
tree | 2807935cfeca2b4bc8335352d7b134fa5b58f0e7 /src/network/res_querydomain.c | |
parent | 9ce2860fa34ede8f84b8ca5ac1746a58b171a023 (diff) | |
download | musl-07355f503a9b0a3ab7a051e2931499a4c5898b15.tar.gz musl-07355f503a9b0a3ab7a051e2931499a4c5898b15.tar.bz2 musl-07355f503a9b0a3ab7a051e2931499a4c5898b15.tar.xz musl-07355f503a9b0a3ab7a051e2931499a4c5898b15.zip |
accept trailing . and empty domain names
trailing . should be accepted in domain name strings by convention
(RFC 1034), host name lookup accepts "." but rejects empty "", res_*
interfaces also accept empty name following existing practice.
Diffstat (limited to 'src/network/res_querydomain.c')
-rw-r--r-- | src/network/res_querydomain.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/res_querydomain.c b/src/network/res_querydomain.c index 8ba31f45..727e6f6b 100644 --- a/src/network/res_querydomain.c +++ b/src/network/res_querydomain.c @@ -3,10 +3,10 @@ int res_querydomain(const char *name, const char *domain, int class, int type, unsigned char *dest, int len) { - char tmp[254]; - size_t nl = strnlen(name, 254); - size_t dl = strnlen(domain, 254); - if (nl+dl+1 > 253) return -1; + char tmp[255]; + size_t nl = strnlen(name, 255); + size_t dl = strnlen(domain, 255); + if (nl+dl+1 > 254) return -1; memcpy(tmp, name, nl); tmp[nl] = '.'; memcpy(tmp+nl+1, domain, dl+1); |