From d8bddef3f45fe64160643e6d99d0e89da2b53d37 Mon Sep 17 00:00:00 2001 From: Ryan Fairfax Date: Wed, 6 Mar 2019 14:35:28 -0800 Subject: [PATCH] Update dn_skipname to work with utf-8. The original logic considered each byte until it either found a 0 value or a value >= 192. This means if a string segment contained utf-8 where a byte was >= 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. --- src/network/dn_skipname.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/network/dn_skipname.c b/src/network/dn_skipname.c index d54c2e5d..8a87b20a 100644 --- a/src/network/dn_skipname.c +++ b/src/network/dn_skipname.c @@ -2,11 +2,12 @@ int dn_skipname(const unsigned char *s, const unsigned char *end) { - const unsigned char *p; - for (p=s; p=192) if (p+1