Add two EXTRACT_U_1() macro calls

This commit is contained in:
Francois-Xavier Le Bail 2018-06-16 14:25:06 +02:00
parent 52f7baee0c
commit 3b0b3f0def

View File

@ -235,11 +235,11 @@ name_len(netdissect_options *ndo,
c = EXTRACT_U_1(s); c = EXTRACT_U_1(s);
if ((c & 0xC0) == 0xC0) if ((c & 0xC0) == 0xC0)
return(2); return(2);
while (*s) { while (EXTRACT_U_1(s)) {
if (s >= maxbuf) if (s >= maxbuf)
return(-1); /* name goes past the end of the buffer */ return(-1); /* name goes past the end of the buffer */
ND_TCHECK_1(s); ND_TCHECK_1(s);
s += (*s) + 1; s += EXTRACT_U_1(s) + 1;
ND_TCHECK_1(s); ND_TCHECK_1(s);
} }
return(PTR_DIFF(s, s0) + 1); return(PTR_DIFF(s, s0) + 1);