X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/a5211097d02144ddd11f71f07c01697750c69fd9..10dd76aef1d2b2b6563bc0f3ef066c76461c84d0:/print-smb.c diff --git a/print-smb.c b/print-smb.c index caf05b2a..6592c5eb 100644 --- a/print-smb.c +++ b/print-smb.c @@ -1199,7 +1199,7 @@ nbt_udp137_print(netdissect_options *ndo, p = smb_fdata(ndo, p, "NumNames=[B]\n", p + 1, 0); if (p == NULL) goto out; - while (numnames--) { + while (numnames) { p = smb_fdata(ndo, p, "Name=[n2]\t#", maxbuf, 0); if (p == NULL) goto out; @@ -1224,6 +1224,7 @@ nbt_udp137_print(netdissect_options *ndo, ND_PRINT(" "); ND_PRINT("\n"); p += 2; + numnames--; } } else { if (p >= maxbuf)