From: TCY16 <8014108+TCY16@users.noreply.github.com> Date: Fri, 21 May 2021 14:09:18 +0000 (+0200) Subject: Apply suggestions from code review X-Git-Tag: release-1.13.2rc1~42^2~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=21c5aadbcdcb5acc1f6d2b9c0f2e44b0275f1d41;p=thirdparty%2Funbound.git Apply suggestions from code review Co-authored-by: Willem Toorop --- diff --git a/sldns/str2wire.c b/sldns/str2wire.c index f905939fd..05a623a2d 100644 --- a/sldns/str2wire.c +++ b/sldns/str2wire.c @@ -1077,8 +1077,8 @@ sldns_str2wire_svcbparam_ipv4hint(const char* val, uint8_t* rd, size_t* rd_len) ip_wire_dst++; count--; } - // if (count) /* verify that we parsed all values */ - // ERROR "Could not parse ipv4hint SvcParamValue: " + if (count) /* verify that we parsed all values */ + return LDNS_WIREPARSE_ERR_SYNTAX_IP4; return LDNS_WIREPARSE_ERR_OK; } diff --git a/sldns/wire2str.c b/sldns/wire2str.c index 8ade3daca..0d41a2bb8 100644 --- a/sldns/wire2str.c +++ b/sldns/wire2str.c @@ -984,14 +984,14 @@ sldns_wire2str_svcparam_ipv4hint2str(char** s, return 0; /* wireformat error, incorrect size or inet family */ w += sldns_str_print(s, slen, "=%s", ip_str); - data += LDNS_IP4ADDRLEN / sizeof(uint16_t); + data += LDNS_IP4ADDRLEN; while ((data_len -= LDNS_IP4ADDRLEN) > 0) { if (inet_ntop(AF_INET, data, ip_str, sizeof(ip_str)) == NULL) return 0; /* wireformat error, incorrect size or inet family */ w += sldns_str_print(s, slen, ",%s", ip_str); - data += LDNS_IP4ADDRLEN / sizeof(uint16_t); + data += LDNS_IP4ADDRLEN; } }