]> The Tcpdump Group git mirrors - tcpdump/commit
Do more bounds checking in unistr().
authorGuy Harris <[email protected]>
Mon, 20 May 2019 07:25:10 +0000 (00:25 -0700)
committerGuy Harris <[email protected]>
Mon, 20 May 2019 07:25:10 +0000 (00:25 -0700)
commitdaa343d8e215a6704ee37399a77a70133df51e01
tree4a0d59f362e3290d4cd6a622ab7f74f92c3b93cf
parentd1b7389cac0ce3c9ccbeede1ea604ad18e9cf965
Do more bounds checking in unistr().

If we quit because we see a NUL, make sure we have all the remaining
data claimed to be in the string, so that our caller doesn't add a
ridiculously large number to the current packet pointer and overflow it.

Keep processing packets even if we see more than MAX_UNISTR_SIZE
characters to print - just don't add them to the buffer - so that we
check the presence of every byte in the string.

Also, print the string even if it was truncated, *but* quit processing
after that.  Print a newline if smb_fdata1() indicates a truncation and
if there's a newline in the format string after the item being printed,
so the newline is printed no matter what.
smbutil.c