Ethereal-dev: [Ethereal-dev] tvb_get_ephemeral_string() not printing the complete string

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

From: "Jasim Tariq" <jasimtariqjt@xxxxxxxxxxx>
Date: Mon, 17 Apr 2006 13:41:33 -0700

Hi,

 

    My tvbuff_t is 500 bytes long, in this case ctvb. I am trying to print a 322 byte string using the tvb_get_ephemeral_string() function with the following parameters using the following call:

 

pindex = 178;

 

length = tvb_length_remaining(ctvb, pindex);  // in this case my length comes out to be 322 bytes (correct)

proto_tree_add_text(my_tree, ctvb, pindex, -1, "Length of ctvb: %u", tvb_length(ctvb));  // in this case my length of ctvb prints out to me 500 bytes (correct)

proto_tree_add_text(my_tree, ctvb, pindex, length, "Message: %s", tvb_get_ephemeral_string(ctvb, pindex, length));

 

I can only print first 230 bytes of the 322 bytes long string in the Packet Details Pane. If I even try to get anything after the 230th byte. I get an error in Ethereal that says Malformed Packet. Why is this happening? Please help me

 

Thanks,

Jasim