mirror of
https://github.com/fluencelabs/musl
synced 2025-06-27 13:41:57 +00:00
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).
This commit is contained in:
@ -17,7 +17,7 @@ int __dn_expand(const unsigned char *base, const unsigned char *end, const unsig
|
|||||||
} else if (*p) {
|
} else if (*p) {
|
||||||
j = *p+1;
|
j = *p+1;
|
||||||
if (j>=end-p || j>space) return -1;
|
if (j>=end-p || j>space) return -1;
|
||||||
while (--j) *dest++ = *p++;
|
while (--j) *dest++ = *++p;
|
||||||
*dest++ = *++p ? '.' : 0;
|
*dest++ = *++p ? '.' : 0;
|
||||||
} else {
|
} else {
|
||||||
if (len < 0) len = p+1-src;
|
if (len < 0) len = p+1-src;
|
||||||
|
Reference in New Issue
Block a user