Wireshark-bugs: [Wireshark-bugs] [Bug 2518] 'tshark -Tfields -e data' Omits Last Character of Da

Date: Sat, 3 May 2008 13:36:09 -0700 (PDT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2518


Alon Tal <alon@xxxxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1768|                            |review_for_checkin?
               Flag|                            |




--- Comment #1 from Alon Tal <alon@xxxxxxxxxxx>  2008-05-03 13:36:08 GMT ---
Created an attachment (id=1768)
 --> (http://bugs.wireshark.org/bugzilla/attachment.cgi?id=1768)
Fix for Missing Char in Output of 'tshark -Tfields -e data'

The 'len' variable was set to a too-low value. 
This variable is provided as the 2nd parameter (Target buffer size) to
g_snprintf(), and is decremented as bytes are written to the target array
('buffer').
The bug occurs when the loop reaches the final byte -- at that point, len==2,
which is insufficient for the hex-string representation + terminated null: 3
bytes are required.
Fixed by changing the calculation of 'len' so that it represents the actual
storage needed, including the terminating null.


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.