Also, don't fetch it until we need it, so we can do a little more
dissection before reporting a truncated packet.
ND_TCHECK(buf[9]);
request = (buf[9] & 0x80) ? 0 : 1;
- flags2 = EXTRACT_LE_16BITS(&buf[10]);
- unicodestr = flags2 & 0x8000;
- nterrcodes = flags2 & 0x4000;
startbuf = buf;
command = buf[4];
if (ndo->ndo_vflag < 2)
return;
+ ND_TCHECK_16BITS(&buf[10]);
+ flags2 = EXTRACT_LE_16BITS(&buf[10]);
+ unicodestr = flags2 & 0x8000;
+ nterrcodes = flags2 & 0x4000;
+
/* print out the header */
smb_fdata(ndo, buf, fmt_smbheader, buf + 33, unicodestr);