Wireshark-dev: Re: [Wireshark-dev] Represent byte array longer than MAX_BYTE_STR_LEN as hexstri
From: Jason Cohen <kryojenik2@xxxxxxxxx>
Date: Sun, 4 Aug 2019 10:07:35 -0500
Really in my case the largest had been 64 bytes.  I have rewritten things to use tvb_memdup, tvb_memcp, and tvb_memeql.  At this point it's a bit academic, but is the use of tvb_get_ptr() so bad in this case.  It is used quite frequently in dissector code and other libwireshark base code.  Really just trying to understand now.

On Sat, Aug 3, 2019 at 9:32 PM Guy Harris <guy@xxxxxxxxxxxx> wrote:
On Aug 3, 2019, at 7:27 PM, Jason Cohen <kryojenik2@xxxxxxxxx> wrote:

> On Sat, Aug 3, 2019 at 9:15 PM Guy Harris <guy@xxxxxxxxxxxx> wrote:
>> On Aug 3, 2019, at 4:39 PM, Jason Cohen <kryojenik2@xxxxxxxxx> wrote:
>>
>>> I've got a lengths of bytes that I need to read from the tvb and render as a hex string that are / may be longer than MAX_BYTE_STR_LEN which is defined as 48.  I do not need the actual bytes from the tvb after I render it as a hexstring.
>>
>> Render where?
>
> In the packet detail. 

OK, so we could increase MAX_BYTE_STR_LEN to, say, 256, but:

        1) that wouldn't handle an *arbitrary* length - it'll *still* get cut off at 240 bytes;

        2) it'd be a lot of hex digits to stare at, possibly requiring horizontal scrolling.

How big can this field get?
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe