Ethereal-dev: [Ethereal-dev] Minor FT_UINT_STRING bugfix.
Hello.
There is a minor bug in proto_tree_add_item() when adding FT_UINT_STRINGs
with more than a single byte for their size. The function will properly
get the string's size; however, when fetching the string, only the first
byte is skipped.
Attached you will find a patch for this bug against the 0.8.19 Ethereal
source code. proto_tree_add_item() will now properly skip over the entire
string size field.
-Lee Berger
lberger@xxxxxxx
diff -ru dist-ethereal-0.8.19/epan/proto.c ethereal-0.8.19/epan/proto.c
--- dist-ethereal-0.8.19/epan/proto.c Fri Jul 13 09:52:28 2001
+++ ethereal-0.8.19/epan/proto.c Sat Aug 4 11:50:39 2001
@@ -542,11 +542,11 @@
case FT_UINT_STRING:
/* This g_strdup'ed memory is freed in proto_tree_free_node() */
n = get_uint_value(tvb, start, length, little_endian);
- proto_tree_set_string_tvb(new_fi, tvb, start + 1, n);
+ proto_tree_set_string_tvb(new_fi, tvb, start + length, n);
/* Instead of calling proto_item_set_len(), since we don't yet
* have a proto_item, we set the field_info's length ourselves. */
- new_fi->length = n + 1;
+ new_fi->length = n + length;
break;
default:
g_error("new_fi->hfinfo->type %d (%s) not handled\n",