diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2010-09-08 09:33:53 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2010-09-08 09:33:53 +0000 |
commit | 9562d30a1341d348111798414cfa611e76e4d908 (patch) | |
tree | e914f45666a555bf4453138db773cc7d24635308 /epan/proto.c | |
parent | bc11261a756b89a17755b5120d1ce23693dd1d7b (diff) |
Allow for proto_tree_add_item() with FT_ABSOLUTE_TIME and FT_RELATIVE_TIME
to have length == 4 (only seconds).
svn path=/trunk/; revision=34078
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/epan/proto.c b/epan/proto.c index 56963aae46..cbcb56ba30 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -1464,7 +1464,7 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree, case FT_ABSOLUTE_TIME: case FT_RELATIVE_TIME: - DISSECTOR_ASSERT(length == 8); + DISSECTOR_ASSERT(length == 8 || length == 4); /* * NOTE: to support code written when * proto_tree_add_item() took a gboolean as its @@ -1480,10 +1480,16 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree, */ if (encoding) { time_stamp.secs = tvb_get_letohl(tvb, start); - time_stamp.nsecs = tvb_get_letohl(tvb, start+4); + if (length == 8) + time_stamp.nsecs = tvb_get_letohl(tvb, start+4); + else + time_stamp.nsecs = 0; } else { time_stamp.secs = tvb_get_ntohl(tvb, start); - time_stamp.nsecs = tvb_get_ntohl(tvb, start+4); + if (length == 8) + time_stamp.nsecs = tvb_get_ntohl(tvb, start+4); + else + time_stamp.nsecs = 0; } proto_tree_set_time(new_fi, &time_stamp); break; |