]> The Tcpdump Group git mirrors - tcpdump/blobdiff - smbutil.c
More EXTRACT_8BITS(), more ND_TCHECK_nBITS(), other cleanups.
[tcpdump] / smbutil.c
index 71ad60d9b491bee81f9b995f93c484eead8468e3..d18a140f5ca28020382aebf56dd26b702cdae4f8 100644 (file)
--- a/smbutil.c
+++ b/smbutil.c
@@ -133,7 +133,8 @@ name_interpret(netdissect_options *ndo,
     if (in >= maxbuf)
        return(-1);     /* name goes past the end of the buffer */
     ND_TCHECK2(*in, 1);
-    len = (*in++) / 2;
+    len = EXTRACT_8BITS(in) / 2;
+    in++;
 
     *out=0;
 
@@ -684,8 +685,10 @@ smb_fdata1(netdissect_options *ndo,
          {
            int l = atoi(fmt + 1);
            ND_TCHECK2(*buf, l);
-           while (l--)
-               ND_PRINT((ndo, "%02x", *buf++));
+           while (l--) {
+               ND_PRINT((ndo, "%02x", EXTRACT_8BITS(buf)));
+               buf++;
+           }
            fmt++;
            while (isdigit((unsigned char)*fmt))
                fmt++;