Replace some proto_tree_add_string_format with proto_tree_add_item +
authorEvan Huus <eapache@gmail.com>
Wed, 30 Oct 2013 02:09:34 +0000 (02:09 -0000)
committerEvan Huus <eapache@gmail.com>
Wed, 30 Oct 2013 02:09:34 +0000 (02:09 -0000)
commita3648730a6c8f5684f2c3708311c2c495b8422e9
tree1e098c381602310b84447e1feb0c040a912c4610
parent1c96e97f71661b629340ed8f6da9bdaea431cf27
Replace some proto_tree_add_string_format with proto_tree_add_item +
proto_tree_set_text - the string was not the important part, the formatting was.
We were passing the string directly from tvb_get_ptr, but this meant that if the
packet didn't contain a null-terminator we would run off the end. Since the
string comes straight from the packet, just let _add_item handle the length
calculations etc efficiently, and set the display later.

Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9323

I'm a bit confused honestly why most of these are being set hidden after being
added and formatted, but at least there are no memory errors anymore.

svn path=/trunk/; revision=52979
epan/dissectors/packet-http.c