Fix dname_has_label() code review changes
@@ -549,9 +549,13 @@ dname_lab_startswith(uint8_t* label, char* prefix, char** endptr)
int
dname_has_label(uint8_t* dname, uint8_t* label)
{
- uint8_t lablen = *dname++;
- if(memlowercmp(dname, label, lablen) == 0)
+ uint8_t lablen = *dname;
+ while(lablen) {
+ if(lablen == *label && memlowercmp(dname, label, lablen) == 0)
return 1;
+ dname += lablen;
+ lablen = *dname;
+ }
return 0;
}
