In convert_string_case() use g_utf8_strup() instead of converting each
character by hand. Hopefully this won't cause any unexpected changes in
behavior.
svn path=/trunk/; revision=36006
truncates newly created and copied strings. The problem was that
strlen() (which returns a length not counting the NULL terminator) was
being mixed with functions that do malloc() (which need to allocate
memory large enough to inculde the NULL string terminator).
svn path=/trunk/; revision=35128
WIRESHARK_SE_VERIFY_POINTERS that control whether or not we verify if a given
pointer is ep_ or se_ allocated, respectively.
Turn the behavior off by default for speed reasons (the speed difference isn't
huge, but...).
Turn the behavior on when fuzz testing.
Document these two new variables in the man pages.
svn path=/trunk/; revision=34046
Added se_tree_lookup32_array_le to emem.[ch]. This function is similar to
se_tree_lookup32_le already defined.
Updated README.binarytrees to reflect this added function and corrected minor
spelling issues.
svn path=/trunk/; revision=31812
"g_strlcpy() assumes that src *IS* ASCII NUL terminated. If the src buffer is
not NUL terminated, g_strlcpy() *WILL* read past the end of the buffer."
svn path=/trunk/; revision=31782
Switch back to checking size instead of asize in emem_alloc_chunk. Make
sure we don't try to cross the streams by allocating a negative amount
of memory in the LTP dissector.
svn path=/trunk/; revision=31132
using chunks. With this change, xx_init_chunk() are only called once at
startup (as their comments imply).
Instead, set free_list to NULL in emem_free_all() (if we're not using chunks).
svn path=/trunk/; revision=30644
There is emem_header_t struct, so IMHO is better to use struct instead of
global variables.
Split emem_alloc() into two functions: emem_alloc_chunk and emem_alloc_glib.
Current allocator is available in emem_header_t.memory_alloc
It should be easier to develop new memory allocator and maintain current.
It might also give some speedup (we don't need to check mem->debug_use_chunks
every time :)
From me:
Initialize emem_header_t.trees. Some indentation cleanup.
svn path=/trunk/; revision=30624
WIRESHARK_DEBUG_SCRUB_MEMORY to turn it on) this function initializes all
allocated memory to 0xBADDCAFE and all freed memory to 0xDEADBEEF. (Of course
the allocation functions like ep_alloc0() re-initialize the allocated memory
back to 0.)
svn path=/trunk/; revision=30579
is to big when allocating lot's of memory. EP memory does not suffer as much as we seems to only allocate one chunk for EP memory.
svn path=/trunk/; revision=30397
Add print_alloc_stats() will show some (hopefully useful) statistics about the
memory we have allocated, the average allocation size, the amount of
overhead/waste, etc.
svn path=/trunk/; revision=30371
* WIRESHARK_DEBUG_EP_NO_CHUNKS
* WIRESHARK_DEBUG_SE_NO_CHUNKS
* WIRESHARK_DEBUG_EP_NO_CANARY
* WIRESHARK_DEBUG_SE_NO_CANARY
This allows us to enable/disable memory chunks and canaries at runtime _without_ needing to recompile.
svn path=/trunk/; revision=29375
-Bugs
* str->len not set correctly in some cases;
* trailing '\0' not always accounted for;
* (issues relating to determining when & how much
to expand string buffer).
-Other
* Change append, append_c, truncate to return
pointer to ep_strbuf (similar to the corresponding
GString functions);
* Rename certain variables to clarify usage (as I understand
the intended usage);
* ep_strbuf_grow: use current allocated length and not current
string length as the starting point;
* Optimizations;
* Add some additional comments to emem.h ep_strbuf section
* Use consistent indentation throughout emem.c;
svn path=/trunk/; revision=28044
if compiled in and the env var WIRESHARK_DEBUG_EP_CANARY is set:
will check for canary integrity at every call to EP_CHECK_CANARY()
if corruption is found it exits pronting the prior location and the location in which corruption was found.
Hopefully it stops running while the corruptor is still in the stack.
see EP_CHECK_CANARY() calls in packet.c as an example.
svn path=/trunk/; revision=25927
members to be const pointers when that's possible, and throw in some
casts when the GLib API fails to have properly consted arguments.
Use ep_strdup_printf() in some cases.
svn path=/trunk/; revision=25596
libwireshark (and the plugins using those functions) do not depend on
wiretap on Windows.
While doing that, rename the eth_* functions to ws_*.
svn path=/trunk/; revision=25354
The variables ep_canary[], se_canary[], ep_packet_mem and se_packet_mem are
only used in emem.c, so the visibility can be file local (static).
svn path=/trunk/; revision=25132
- Change ugly GLIB version checking statements to GLIB_CHECK_VERSION
- Remove ws_strsplit files because we no longer need to borrow GLIB2's
g_strsplit code for the no longer supported GLIB1 builds
svn path=/trunk/; revision=24829
Reads EMEM_CANARY_DATA_SIZE (15) bytes, compares return value to EMEM_CANARY_SIZE (8).
Also, I also added setbuf call in patch so it reads 15 bytes instead of 4096 or 8192.
svn path=/trunk/; revision=24596
will traverse the entries in the lexical order of the key.
add a flag to lookup/insert for strings to specify whether a case
insensitive key should be used instead of a (default) case sensitive
key.
svn path=/trunk/; revision=23736
- As noted by Thomas Anders values are not added to the tree anymore. Move the calling of subdissectors to the end of the function, so that the value is added to the tree.
- add port 8161 to be decoded as SNMP (hey, it's on IANA's services file!)
UAT:
- do not have the uat reloaded.
OIDS:
- do not complain if renaming an OID to an identical name
svn path=/trunk/; revision=22704
In all the places where a cast to "long long" or "unsigned long long"
was done, use G_GINT64_MODIFIER and get rid of the cast, as
1) there's no guarantee that "%ll" works
and
2) there's no guarantee that "long long" works
(the latter definitely does *NOT* work with MSVC++; the former doesn't
work with regular printf in MSVC++, but it might work with the GLib
printf-based functions).
svn path=/trunk/; revision=21978
Fix compilation failures when building wireshark-0.99.6-SVN-21916 on an
x86_64-unknown-linux-gnu target with gcc version 4.1.2 20070403 (Red Hat
4.1.2-8).
The failures fall into two categories:
(1) Casts between pointers and 32-bit integers without an intermediary cast
via 'long' or 'unsigned long'. This results in a compiler warning complaining
about casts between a pointer and an integer of a different size.
(2) Passing values to "%lld" or similar printf-style format options that the
compiler thinks are a different size. Such values need to be cast to 'long
long' or 'unsigned long long'.
svn path=/trunk/; revision=21975
--enable-extra-gcc-checks set.
If we turn on -pedantic, try turning on -Wno-long-long as well, so that
it's not *so* pedantic that it rejects the 64-bit integral data types
that we explicitly require.
Constify a bunch of stuff, and make some other changes, to get rid of
warnings.
Clean up some indentation.
svn path=/trunk/; revision=21526
it broken in one of the previous bugfixes to tcp
add a function to print an emem tree to the console for easier emem tree debugging
svn path=/trunk/; revision=19877
change all accessor functions to be defines to the emem_tree_ functions.
now to create a tree with a different scope we only need to create a new
..._tree_create() function and set up the appropriate defines
(it was a mistake to call the functions se_tree_create and se_tree_create_non_persistent, they should be the other way around i.e. se_tree_create_persistent and se_tree_create )
svn path=/trunk/; revision=18895
teh tree management and to use trees with different storage scope without too much code duplication.
it would be useful with a tree that had indefinite storage instead of the emem functions which commonly have ep or se storage scope.
indefinite storage scope would be useful for example for managing a global and static set of well known guid to name mappings(not yet implemented) and also for
oid to name mappings.
svn path=/trunk/; revision=18886
have neither. For those with MAP_ANON but not MAP_ANONYMOUS, use
MAP_ANON; for those with neither, add some code to use "/dev/zero".
svn path=/trunk/; revision=18488
HP-UX doesn't have MAP_ANON but it does have MAP_ANONYMOUS. Moreoever,
according to mmap(2) on RHEL:
MAP_ANONYMOUS
The mapping is not backed by any file; the fd and offset argu-
ments are ignored. This flag in conjunction with MAP_SHARED is
implemented since Linux 2.4.
MAP_ANON
Alias for MAP_ANONYMOUS. Deprecated.
svn path=/trunk/; revision=18486