about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-08-23 21:25:01 -0400
committerRich Felker <dalias@aerifal.cx>2013-08-23 21:25:01 -0400
commit7211551e9ff7c8c9d1491856088cf832f2722bd6 (patch)
tree82d97ea383d084de57611b8b41188c8a17b0018d /src
parentd2c42ed25f0488c40f61479ac7feb729d98e1d38 (diff)
downloadmusl-7211551e9ff7c8c9d1491856088cf832f2722bd6.tar.gz
musl-7211551e9ff7c8c9d1491856088cf832f2722bd6.tar.xz
musl-7211551e9ff7c8c9d1491856088cf832f2722bd6.zip
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).
Diffstat (limited to 'src')
-rw-r--r--src/network/dn_expand.c2
1 files changed, 1 insertions, 1 deletions
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;