提交 2a0ff45b 编写于 作者: R Ryan Fairfax 提交者: Rich Felker

handle labels with 8-bit byte values in dn_skipname

The original logic considered each byte until it either found a 0
value or a value >= 192. This means if a string segment contained any
byte >= 192 it was interepretted as a compressed segment marker even
if it wasn't in a position where it should be interpretted as such.

The fix is to adjust dn_skipname to increment by each segments size
rather than look at each character. This avoids misinterpretting
string segment characters by not considering those bytes.
上级 4b125dd4
......@@ -2,11 +2,14 @@
int dn_skipname(const unsigned char *s, const unsigned char *end)
{
const unsigned char *p;
for (p=s; p<end; p++)
const unsigned char *p = s;
while (p < end)
if (!*p) return p-s+1;
else if (*p>=192)
if (p+1<end) return p-s+2;
else break;
else
if (end-p<*p+1) break;
else p += *p + 1;
return -1;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册