From 7211551e9ff7c8c9d1491856088cf832f2722bd6 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 23 Aug 2013 21:25:01 -0400 Subject: fix regression in dn_expand/reverse dns off-by-one error copying the name components was yielding junk at the beginning and truncating one character at the end (of every component). --- src/network/dn_expand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/dn_expand.c b/src/network/dn_expand.c index f817d059..4e02e3d2 100644 --- a/src/network/dn_expand.c +++ b/src/network/dn_expand.c @@ -17,7 +17,7 @@ int __dn_expand(const unsigned char *base, const unsigned char *end, const unsig } else if (*p) { j = *p+1; if (j>=end-p || j>space) return -1; - while (--j) *dest++ = *p++; + while (--j) *dest++ = *++p; *dest++ = *++p ? '.' : 0; } else { if (len < 0) len = p+1-src; -- cgit v1.2.1