Commit Graph

128 Commits

Author SHA1 Message Date
Evan Huus 538525918a Don't pass tvb_get_ptr to proto_tree_add_string
If the string doesn't end with a null-terminator in the given length it causes a
read-overflow. Should fix bug #9717.

Change-Id: I44647ef8ecb856e07d1175777ed603736ec63553
Reviewed-on: https://code.wireshark.org/review/90
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-03 16:18:54 +00:00
Evan Huus 6be37815a1 Add bytestring_to_str() which takes a wmem scope and is otherwise identical to
bytestring_to_ep_str (now deprecated). Use the new one in a few obvious places.

Also just print directly to the buffer when loading ethernet addresses for
resolution. The straight-to-buffer bytes_to_hexstr seems useful, maybe it
shouldn't be in a private header...

svn path=/trunk/; revision=54270
2013-12-19 20:53:44 +00:00
Evan Huus a6415ece0a Rename a couple of to_str functions to have ep_ in the name. This makes it
obvious that the returned string is ephemeral, and opens up the original names
in the API for versions that take a wmem pool (and thus can work in any scope).

svn path=/trunk/; revision=54249
2013-12-19 15:49:09 +00:00
Jakub Zawadzki 65db82872c When including <epan/prefs.h> don't force inclusion of <epan/uat.h>
svn path=/trunk/; revision=53769
2013-12-03 22:16:49 +00:00
Guy Harris db25270df8 Move the epan/filesystem.c routines to wsutil; they're not specific to
packet dissection, they're specific to the entire Wireshark suite of
programs.

svn path=/trunk/; revision=53377
2013-11-17 02:55:14 +00:00
Graham Bloice 9c4ee86784 Add CMake properties to targets so that they are logically organised when using a Visual Studio solution.
Add CMake properties to group the source files in epan into logical blocks when using a Visual Studio solution.

svn path=/trunk/; revision=52580
2013-10-13 09:21:55 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- 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
2013-09-22 15:50:55 +00:00
Pascal Quantin 953c6fed13 emem -> wmem
svn path=/trunk/; revision=52130
2013-09-17 21:34:05 +00:00
Michael Mann 7ec34a52c5 expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51850
2013-09-09 00:11:19 +00:00
Jeff Morriss 54bb2e7a5c Move report_err.{h,c} from epan into wsutil: there's nothing epan-specific there and moving it avoids having to recompile the file for use in editcap and capinfos (which don't link against libwireshark).
svn path=/trunk/; revision=50598
2013-07-15 02:48:26 +00:00
Evan Huus 53c6595bd9 Add our license header to plugin moduleinfo.h files. Cleans up a batch of
licensecheck warnings.

svn path=/trunk/; revision=50407
2013-07-06 13:31:31 +00:00
Bill Meier 3f4fb4d56b Define certain 'const char *...' arrays as static.
(That is: Don't create the array on the stack each time
  the function is called).

 Reduces code memory usage and execution time.
 (See SVN #50271)


svn path=/trunk/; revision=50296
2013-07-01 14:40:58 +00:00
Michael Mann dffc4fefc6 Batch (some of) the plugins to filterable expert infos. The Profinet plugin started to get a bit complex in determining filter names (especially the DCOM stuff), so I'll leave that to someone more familiar with the protocol.
svn path=/trunk/; revision=49624
2013-05-29 23:41:33 +00:00
Guy Harris 4b34417a5e Fix FSF address.
svn path=/trunk/; revision=48907
2013-04-18 02:04:18 +00:00
Anders Broman f92bd64966 [-Wmissing-prototypes]
Use explicit casts.

svn path=/trunk/; revision=48439
2013-03-20 05:59:22 +00:00
Jaap Keuter 827eb58b04 From David Arnold:
Replace use of INCLUDES with AM_CPPFLAGS in all Makefiles to placate recent autotools.

svn path=/trunk/; revision=48261
2013-03-12 06:53:39 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Guy Harris 29715ccc8f How can I get a new tvbuff that starts at an offset within a given
tvbuff and runs to the end of the tvbuff?  Let me count the ways....

Replace a bunch of different ways of doing that (some incorrect, in that
they're not properly handling tvbuffs where the captured and reported
lengths are different) with tvb_new_subset_remaining().

svn path=/trunk/; revision=47751
2013-02-19 23:17:07 +00:00
Bill Meier f784806968 Comment out numerous unused hf_.... instances found by checkhf.
svn path=/trunk/; revision=47617
2013-02-10 20:52:21 +00:00
Guy Harris 0a20c5dd91 Add %option noinput to some Flex files, as we aren't using the input()
routine and thus don't need to have it generated - and as it produces
warnings of a routine defined but not used, we don't want to have it
generated.

svn path=/trunk/; revision=47616
2013-02-10 20:21:05 +00:00
Guy Harris 19aa5dbe46 "make maintainer-clean" should nuke all generated files.
svn path=/trunk/; revision=47594
2013-02-09 19:32:31 +00:00
Guy Harris c8af93ea2d Get rid of trailing tabs, make comments more similar.
svn path=/trunk/; revision=47593
2013-02-09 19:30:18 +00:00
Guy Harris e30d2b5001 Make the other plugin makefiles use the new style introduced in the MATE
makefiles.

svn path=/trunk/; revision=47579
2013-02-09 05:31:15 +00:00
Michael Mann 86d690880f replace "unsigned" datatype with "guint". Some mpeg files needed "unsigned int" instead.
bugs 7825-7827 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7825)

svn path=/trunk/; revision=46928
2013-01-04 05:22:43 +00:00
Guy Harris ef175a2208 Squelch some more discarding-qualifiers warnings.
svn path=/trunk/; revision=46770
2012-12-26 11:24:39 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Bill Meier a4128c56b9 General cleanup:
- Use/create extended value strings as appropriate;
- Reformat hf[] entries;
- Do whitespace, & etc changes to use a consistent formatting style;
- Reformat some long lines;
- Localize some variables; remove some unneeded initializers;
- expert...() shouldnt be called under 'if (tree)' (packet-wimaxasncp);
- Move proto_register...() & etc to the end of the file (packet-ieee80211);
- Misc.

svn path=/trunk/; revision=46489
2012-12-10 14:50:32 +00:00
Bill Meier 7cd0417af5 Fix numerous instances of a variable/parameter name "shadowing" a library function name;
(At least some (gcc ?) compilers give a "shadow" warning for these).

svn path=/trunk/; revision=46402
2012-12-05 15:56:36 +00:00
Bill Meier 0a94d24771 Fix several [-Wshadow] warnings.
svn path=/trunk/; revision=46287
2012-11-29 16:22:54 +00:00
Michael Mann 8dcfa4214c replace unnecessary decode_numeric_bitfield calls
svn path=/trunk/; revision=45154
2012-09-26 18:33:10 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +00:00
Jakub Zawadzki 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +00:00
Jakub Zawadzki b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Bill Meier 3d4b3f2784 Set Makefile.common as a plugin.c dependency so plugin.c is rebuilt if Makefile.common is changed
svn path=/trunk/; revision=42972
2012-06-01 14:44:35 +00:00
Bill Meier 1caa79ad80 Windows: Set Makefile.common as a plugin.c dependency so plugin.c is rebuilt if Makefile.common is changed
ToDo: ditto for Makefile.am ?

svn path=/trunk/; revision=42971
2012-06-01 14:08:12 +00:00
Guy Harris 944ae5ae49 Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_item() calls.

svn path=/trunk/; revision=42590
2012-05-11 20:02:52 +00:00
Anders Broman b1b0af6e66 From Pascal Quantin:
Fix Bug 6793  Some WiMAX messages decoded incorrectly

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6793

svn path=/trunk/; revision=42045
2012-04-13 13:02:57 +00:00
Jeff Morriss 75c3c92f19 Add a "-build" argument to checkAPIs.pl. Use that argument when building
from makefiles (and thus from the buildbot).

The intention is to be able to tell when a human is running the tool so we
can provide more code-review guidance.

As a starter, enable the "too many proto_tree_add_text() calls" check when
a human is running the tool.

svn path=/trunk/; revision=41943
2012-04-04 20:46:49 +00:00
Bill Meier 605dea0486 CVARSDLL hasn't been used (is undefined) for a while....
svn path=/trunk/; revision=41180
2012-02-24 16:23:38 +00:00
Anders Broman 8e97665863 Add *.sbr files to the clean target.
svn path=/trunk/; revision=40761
2012-01-29 20:03:39 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Bill Meier cca6984ab9 Do some more conversions of proto_tree_add_item() 'encoding' arg
(previously missed).

svn path=/trunk/; revision=39450
2011-10-18 00:17:48 +00:00
Chris Maynard cfca66f6e1 Remove const qualifier to name, abbrev and blurb to pacify the buildbots.
svn path=/trunk/; revision=36860
2011-04-26 01:06:25 +00:00
Guy Harris 34f8f7e77d Get rid of some unnecessary casts that just provoke uninteresting
warnings.

More fun with GArrays: cast away some warnings that don't report real
alignment problems and that wouldn't even happen if the "data" member of
a GArray were a "void *".

svn path=/trunk/; revision=36856
2011-04-25 21:20:47 +00:00
Chris Maynard 735b61500c Don't dereference a NULL pointer. Fixes CID 426.
svn path=/trunk/; revision=36424
2011-03-31 18:00:26 +00:00
Martin Mathieson 7356320a2a Don't assign proto_item pointers that are not used.
Coverity 1174

svn path=/trunk/; revision=36395
2011-03-29 14:23:13 +00:00
Guy Harris 3eecbb3248 Just use g_strdup_printf(), rather than doing it ourselves.
svn path=/trunk/; revision=35780
2011-02-03 08:31:04 +00:00
Bill Meier d3efa3ed9f A bit of Windows makefiles rework and cleanup:
- Define macros for certain CFLAGS in config.nmake iso of having defs in each makefile;
  a. -DHAVE_CONFIG_H and -D_U_="" are now part of a macro named STANDARD_CFLAGS;
  b. -WX has been replaced by WARNINGS_ARE_ERRORS (defined as -WX in config.nmake)
      (This allows disabling "Warnings as Errors" by just changing config.nmake)
  c. CVARSDLL definitions (not usage) have been removed from the various makefiles.
     XXX: It appears the usage of CVARSDLL can also be removed (not yet done) since:
     -DWIN32 and -DNULL=0 do not appear to be needed (any more);
     -D_MT and _D_DLL  are not needed since /MP causes these definitions.
  d. Define a macro WARNINGS_CFLAGS with additional specific compiler (level4) warnings to be enabled.
     E.G., 4295: array is too small to include a terminating null character
- config.nmake: reformat some long lines for readability;
- plugins\Makefile.nmake: clean-deps does nothing: remove it (and usage in top-level makefile);
- dissectors/Makefile.nmake: test to enable packet-rrc.obj target needs to include MSVC2010 ...

svn path=/trunk/; revision=35747
2011-02-02 01:19:53 +00:00
Jeff Morriss f53744b59d There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_*(): just use proto_tree_add_item().
   
Replace some tvb_get_ptr()s with tvb_get_ephemeral_string().

svn path=/trunk/; revision=35603
2011-01-21 03:00:31 +00:00