summaryrefslogtreecommitdiff
path: root/print-smb.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-05-22 09:15:34 -0700
committerGuy Harris <guy@alum.mit.edu>2019-05-22 09:15:34 -0700
commit944a5e22aab5c62706df1acef419ac6432de8f29 (patch)
treea081479886c51606f2ca7386ce1d88c2b9695c8e /print-smb.c
parentae693dc2121f6fe1c7f42ece00b54b16e84c400f (diff)
downloadtcpdump-944a5e22aab5c62706df1acef419ac6432de8f29.tar.gz
Don't use leftover string length values.
Before processing an SMB request or response, set the string length variable to 0, and set a flag indicating whether we *have* a string length variable to "false". Set the latter to "true" only if we explicitly set the string length, and if it's not set when we process a counted string, report an error. (That *shouldn't* happen, but *can* happen in a malformed packet, such as an NT Create AndX request with a zero word count, meaning "no word parameters" and thus "no string length word parameter".)
Diffstat (limited to 'print-smb.c')
-rw-r--r--print-smb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/print-smb.c b/print-smb.c
index 5a66b67b..39125efa 100644
--- a/print-smb.c
+++ b/print-smb.c
@@ -867,6 +867,7 @@ print_smb(netdissect_options *ndo,
f2 = fn->descript.rep_f2;
}
+ smb_reset();
if (fn->descript.fn)
(*fn->descript.fn)(ndo, words, data, buf, maxbuf);
else {