These GMemChunks are used here because :
1, GMemChunks are cheap to allocate and cheap to free
2, We always unconditionally free the entire chunk When and only when we load a new capture.
==>
se_alloc() does exactly the same thing but with significantly less code
==>
se_alloc() is a much better fit to out allocation requirements and useage than GMemChunks
svn path=/trunk/; revision=15303
doesn't give you the address value, it gives a pointer to the address
value.
Don't assume that pointer is aligned on a 32-bit boundary.
svn path=/trunk/; revision=15300
The generated file has a lot of indentation changes due probably to a change in asn2eth.
The underlying reason for which I added this code (dissect_ber_integer() would not add as a "filterable" field if it is larger than 4 bytes, should be handled in dissect_ber_integer() ) remains there.
Should we change dissect_ber_integer() itself to make sure that a 5 byte unsigned integer which fits in 4 bytes gets added to the tree as "filterable"?
svn path=/trunk/; revision=15294
If we encounter a frame we have already seen (i.e. visited==1) but we can not fing the ISCSI command inside the _matched table, this just means there were no response pdu nor any data pdu with the S bit set.
So, then just pick the cdata structure up from the _unmatched table instead.
The SCSI CDB dissector really really want a real CDATA structure passed to it.
svn path=/trunk/; revision=15291
as heuristics they are not 100% perfect, else they would not be heuristics.
IF the preference option "Dissect unknown RPC program numbers" are enabled,
add a sanity check to see that program_version is <=10
(no one uses versions >10 ?)
to avoid trying to add 2 bilion different versions to the program->version linked list
in case we mistook the packet for ONC-RPC and the "version" field contains a huge random number.
This bug would only trigger a hang/crash IFF the option above is enabled.
svn path=/trunk/; revision=15290
a dissector bug. This keeps buildbot from opening unnecessary bugs
during fuzz testing.
When we create a new scsi_task_data_t struct make sure all of its
members are initialized.
svn path=/trunk/; revision=15278
-use g_snprintf instead of sprintf and snprintf
-use g_strdup_printf where appropriate
-remove #include "snprintf.h" (as only g_snprintf should be used)
-replace some more alloc/realloc/calloc/free with their glib pendants
svn path=/trunk/; revision=15264
Eric Wedel
Add a preference to RPC (default off) that will heuristically attempt to find
PDUs starting in the middle of a segment.
svn path=/trunk/; revision=15260
the length and object class items into that tree. Put the object class
item into the tree as a visible item, rather than as a hidden item and
as a text entry.
Add some additional length checks.
svn path=/trunk/; revision=15258
There's no need to build a list of all the options and then dissect them
individually; just have one loop that dissects them. (The full list
wasn't being freed, so we were leaking memory.)
Add some more sanity checks.
Clean up a bunch of other things.
svn path=/trunk/; revision=15255
Fix the sizes of some items to match what's in the I-D and what's being
fetched from the packet.
Check for the length of items before doing *anything* with the item,
including fetching the data from the packet. Just put a "bad length"
indication into the protocol tree; don't abort the dissection (we can
just move on to the next TLV).
svn path=/trunk/; revision=15254
user by crashing due to a null pointer dereference, punish the dissector
writer by saying he or she didn't bother providing an explanation of the
error.
The exception message isn't a const string any more; make the
"exception_message" argument to "show_exception()" a "char *", not a
"const char *".
svn path=/trunk/; revision=15251
message not be const (as we generate messages with "g_strdup_sprintf()",
which means they need to be freed; using a null message means that we
don't have to use a special string for exceptions with no message, and
don't have to worry about not freeing that).
Have THROW() throw an exception with a null message pointer. (This
means that you crash if you throw DissectorError with THROW(). Don't do
that - it means you don't get a more detailed explanation of the
dissector problem. Use the DISSECTOR_ASSERT, etc. macros in
epan/proto.h instead.)
Free the exception message for DissectorError, as it's mallocated.
svn path=/trunk/; revision=15250
"tvb_fake_unicode()" never returns a null pointer, so there's no need to
check for it; there's also no need to check that it's not an empty
string before freeing it, as it's always assigned a g_malloc()ed string.
It also takes as an argument the number of Unicode characters in the
string, not the number of bytes in the string.
Use "format_text()" when adding a string to the Info column, in case
it has non-printable characters.
Don't use "proto_tree_add_string_format()" if you don't have to.
svn path=/trunk/; revision=15239
transfer context; that way, we don't have to make "di->xfer" a "const"
pointer, and can thus pass it to "g_free()" (if non-null) without
the compiler whining at us.
Note that telling the user to "click on ASSOC request" is not the best
thing to do, unless we simply cannot determine the right ASSOC request
to click on.
svn path=/trunk/; revision=15238
_U_-ify some unused arguments, rather than assigning them to themselves.
Un-constify one variable that gets assigned a mallocated pointer.
Clean up indentation.
svn path=/trunk/; revision=15236
DissectorError. In packet-kerberos.c, restore pinfo->private_data if
we throw an exception, which keeps the SMB dissector from throwing
a DissectorError. Initialize variables in other places to squelch
valgrind warnings.
svn path=/trunk/; revision=15235