Age | Commit message (Collapse) | Author | Files | Lines |
|
tvbuff.c:1258: warning: passing argument 2 of '__builtin___memcpy_chk' makes pointer from integer without a cast
tvbuff.c:1258: warning: passing argument 2 of '__inline_memcpy_chk' makes pointer from integer without a cast
svn path=/trunk/; revision=53117
|
|
we already have valid ptr from ensure_contiguous() so use it to fill structure.
svn path=/trunk/; revision=53113
|
|
svn path=/trunk/; revision=53112
|
|
ensure_contiguous() will throw exception but won't return NULL.
svn path=/trunk/; revision=53111
|
|
checks and computations. Should contain no behavioural changes at *all*, I hope.
svn path=/trunk/; revision=52768
|
|
svn path=/trunk/; revision=52763
|
|
svn path=/trunk/; revision=52695
|
|
infinite loop to pop up. We're just going to have to eat the performance hit.
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9282)
svn path=/trunk/; revision=52660
|
|
a negative offset (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9277)
svn path=/trunk/; revision=52658
|
|
tvb internal routines with sanity checks to avoid duplicated checks.
svn path=/trunk/; revision=52651
|
|
svn path=/trunk/; revision=52606
|
|
proto_tree_add_item was valid *before* we short-circuited based on a NULL tree.
This was good in that it removed a common source of really-long-loop bugs. It
was less good in that it cost us about 8% in speed when doing a tree-less
dissection, but we decided the tradeoff was worth it.
After Anders' recent mail to -dev about performance, I started thinking about
how to optimize this. It occurred to me that the vast majority of the logic
involved in the check was dealing with the length value - fetching the actual
length if it was a counted string, calculating the length if it was -1, adding
the length to the offset in a way that was free from overflows, etc.
All of this is (theoretically) unnecessary - simply checking the offset without
worrying about the length will still catch the very-long-loops, since it is the
offset that increases in each iteration, not the length.
All that to justify:
- implement tvb_ensure_offset_exists which throws an exception if the offset is
not within the tvb
- use it instead of all the complicated other logic in the pre-short-circuit
step of proto_tree_add_item and friends
This gives us back about 3/4 of the performance we lost in the original patch.
We're still ~2% slower than without any check, but this is the best I can think
of right now.
svn path=/trunk/; revision=52578
|
|
tvb->reported_length. Small performance win on the hot path, and a bit easier to
read.
svn path=/trunk/; revision=52577
|
|
dissecting without tree, they are costly because they now happen for every
proto_tree_add_item call even if tree is NULL.
svn path=/trunk/; revision=52575
|
|
tvb_reported_length_remaining() return 0 instead of -1. This should provide a better long-term fix for bugs/problems such as seen in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9263. In the long-run, if we like this behavior, we can change the return value to a guint as well. Let's let it simmer for awhile first ...
svn path=/trunk/; revision=52571
|
|
- tvb_get_g_stringz()/tvb_get_ephemeral_stringz()/tvb_get_seasonal_stringz() -> tvb_get_stringz()
- tvb_get_g_stringz_enc()/tvb_get_ephemeral_stringz_enc() -> tvb_get_stringz_enc()
- tvb_get_ephemeral_unicode_stringz() -> tvb_get_unicode_stringz()
- tvb_bcd_dig_to_ep_str() -> tvb_bcd_dig_to_wmem_packet_str()
- update docs accordingly
svn path=/trunk/; revision=52180
|
|
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly
svn path=/trunk/; revision=52172
|
|
explicit, and frees up the "generic" names (like tvb_memdup) for new signatures
that take the appropriate wmem pool.
Majority of the conversion done with sed.
svn path=/trunk/; revision=52164
|
|
- support merging chains in tvb_add_to_chain
- when we have an old reassembled TVB, just merge the chains rather than
freeing it (we may still need it as it may already be a data source)
- modelines
Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9027
#BACKPORT, but it's gonna be messy...
svn path=/trunk/; revision=51825
|
|
Add generic tvb_find_guint8, tvb_pbrk_guint8
svn path=/trunk/; revision=51445
|
|
triggered.
svn path=/trunk/; revision=51293
|
|
- make tvb_ops->tvb_size a gsize field, not function call
- remove not needed forward declaration / forward line
svn path=/trunk/; revision=51141
|
|
This means wsutil now links against libcrypt.
Protect a bunch of the crypt header files from multiple inclusion.
svn path=/trunk/; revision=51100
|
|
svn path=/trunk/; revision=51081
|
|
svn path=/trunk/; revision=51071
|
|
svn path=/trunk/; revision=50843
|
|
packet-bacapp.c and/or tvb_generic_clone_offset_len()
Revert r50556: Add new function: validate_offset() which checks if offset is within bounds of tvb.
svn path=/trunk/; revision=50633
|
|
(it seems to be working for TCP ^^)
svn path=/trunk/; revision=50580
|
|
svn path=/trunk/; revision=50569
|
|
svn path=/trunk/; revision=50558
|
|
of tvb.
svn path=/trunk/; revision=50556
|
|
We either want to calculate only offset (compute_offset()), or
offset and remaining length (compute_offset_and_remaining())
Move old generic code to check_offset_length_no_exception())
svn path=/trunk/; revision=50551
|
|
integer overflow
svn path=/trunk/; revision=50550
|
|
return exception number instead of FALSE, and 0 instead of TRUE
+ if there's overflow in check_offset_length_no_exception() just set exception, don't clamp end_offset (it could be an issue for 4GB tvbs :>)
svn path=/trunk/; revision=50549
|
|
abs_offset + subset_offset, abs_offset - subset_offset makes no sense.
Right now it doesn't really matter, cause tvb subsets always have real_data.
Without fix, and with small modification in ensure_contigous_no_expcetion() to first check for ->tvb_get_ptr() and later real_data
epan doesn't work and it flood console with warnings like:
** (process): WARNING **: Dissector bug, protocol IPv4, in packet 3823: tvbuff.c:976: failed assertion "exception > 0"
svn path=/trunk/; revision=50537
|
|
svn path=/trunk/; revision=50498
|
|
implement frame_tvbuff, right now almost a copy of 'real' tvb.
svn path=/trunk/; revision=50497
|
|
svn path=/trunk/; revision=50496
|
|
->tvb_init() knows nothing about new tvb and can only do some kind of bzero()
it's much better if we initialize object after tvb_new() [which anyway must be done]
+ try to fix OSX build.
svn path=/trunk/; revision=50490
|
|
long as first member of struct is tvbuff)
Move some stuff outside tvbuff struct.
svn path=/trunk/; revision=50489
|
|
svn path=/trunk/; revision=50487
|
|
It's begin of work to allow adding new tvbuff types (think: wtap_tvbuff, base64_tvbuff).
svn path=/trunk/; revision=50486
|
|
svn path=/trunk/; revision=50477
|
|
svn path=/trunk/; revision=50464
|
|
svn path=/trunk/; revision=50285
|
|
tvb_length_remaining() as the size argument to the tvb_format_*() functions. Try to do something sane if that value happens to be -1 (or negative in general). One such example is packet-bthfp.c, as found and reported by Coverity in CID 1035325 (Improper use of negative value).
Note: There are other ways to handle this of course, but this fix is suitable for backporting to both 1.10 and 1.8, as it does not break binary compatibility. Is there a better way to fix this though? For now, schedule this for backport.
svn path=/trunk/; revision=50282
|
|
memory with tvb-free-callback.
Fixes one of the "read after free" warnings from Valgrind reported in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8197 and the one reported
in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8653
svn path=/trunk/; revision=49379
|
|
which we're making a subset, so that if the parent tvbuff is marked as a
fragment, the child tvbuff will be marked as one as well.
svn path=/trunk/; revision=48953
|
|
haven't reassembled, we're probably moving sequentially through the
packet, which means that we'll run past the end of the fragment rather
than past the end of what would have been the reassembled packet had we
reassembled it.
I.e., there's little reason to care whether we're past the end of the
fragment but not past the end of the packet, or whether we're past the
end of the packet; in either case, we're past the end of the fragment,
and if somebody wants to know whether the packet is malformed by
stopping short of certain fields, they should enable reassembly.
So we get rid of the explicit fragment length in tvbuffs and, instead,
have a "this is a fragment" flag; if that flag is set, we throw
FragmentBoundsError rather than ReportedBoundsError if we run past the
end of the reported data.
(This also means we could flag the tvbuff even if we don't know how
large the reassembled packet will be, e.g. when doing IP reassembly.)
Replace tvb_new_subset_length_fragment() with tvb_new_subset_length()
and a new "set the "this is a fragment flag"" routine.
svn path=/trunk/; revision=48940
|
|
tvbuff, so we might as well keep all the "here's a new tvbuff" code
together.
svn path=/trunk/; revision=48939
|