Ethereal-dev: [Ethereal-dev] packet-smb question

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Ronnie Sahlberg" <rsahlber@xxxxxxxxxxxxxx>
Date: Sun, 11 Nov 2001 16:29:43 +1100
Hi guy,

The changes you recently made in packet-smb.c in adding an extra parameter
to get_unicode_or_ascii_tvb()
(or what it is called) to make sure we dont read outside the packet for non
null-terminated strings at the end of the packet.

Could that be changed into get_unicode_or_ascii_tvb() itself setting say bc
to tvb_length_remaining() thus eliminating the need
to pass it as a parameter (and getting rid of the extra macros for those
dissectors).
Or would this break something?

I ask because as you might have seen in the last transaction patch I just
ignored the macros in that one
since it was huge and i was lazy.
instead I did bc = tvb_length_remaining(tvb, offset) before any call to
get_unicode_or_ascii_tvb().