]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add two EXTRACT_U_1() macro calls
authorFrancois-Xavier Le Bail <[email protected]>
Sat, 16 Jun 2018 12:25:06 +0000 (14:25 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sat, 16 Jun 2018 13:21:05 +0000 (15:21 +0200)
smbutil.c

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