Commit Graph

114 Commits

Author SHA1 Message Date
Martin Kaiser 0c7eb4a4f4 [dcom] don't THROW() an exception from a dissector
try to clean up the use of signed vs unsigned data types
in dissect_dcom_BSTR without affecting any other function:

offsets are gint
if we have to add a guint32 to an offset, do a range check before adding
if we see an overflow, return the number of bytes consumed up to that point

Change-Id: Ib06c19fee8e3477e07b190ca26743891a5b24c3d
Reviewed-on: https://code.wireshark.org/review/13082
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-07 11:46:17 +00:00
Balint Reczey 9a9b1c9bba Spelling fixes for errors found by lintian
Change-Id: I889283902875193f4d3f3fd59788f59f8d9bcc20
Reviewed-on: https://code.wireshark.org/review/11945
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-07 07:11:54 +00:00
Gerald Combs 86fe2be4dc Use address functions instead of ADDRESS macros in asn1 and epan
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the asn1 and epan directories.

Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4
Reviewed-on: https://code.wireshark.org/review/11200
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22 11:45:56 +00:00
Pascal Quantin d34267d050 DCOM: ensure to initialize IPv4 variable put on the stack
Bug: 11610
Change-Id: I920b88ab035ff34e7cff9eab8158aa2dabe2faac
Reviewed-on: https://code.wireshark.org/review/11134
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-10-18 21:17:53 +00:00
Peter Wu ea46cf4f73 Split init of misc dissectors into init/cleanup functions
Convert remaining dissectors to use cleanup routines when possible.
(Single-)linked lists require NULL, so do reset their pointers to NULL.

Generated with
https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=69af86e6c2cf965ba3d7f9636b647b195f0b7d57
(with AUDIT = ALWAYS_EMIT_CLEANUP_CODE = True)

Remaining dissectors which did not need further changes:
epan/dissectors/packet-aeron.c
epan/dissectors/packet-bootp.c
epan/dissectors/packet-brdwlk.c
epan/dissectors/packet-drda.c
epan/dissectors/packet-etch.c
epan/dissectors/packet-fix.c
epan/dissectors/packet-fw1.c
epan/dissectors/packet-lbm.c
epan/dissectors/packet-ldss.c
epan/dissectors/packet-simulcrypt.c
epan/dissectors/packet-spdy.c
epan/dissectors/packet-starteam.c
epan/dissectors/packet-udp.c

Change-Id: Idcacfea6a5de38d40e67db4cdcd0452ad9f9a6a9
Reviewed-on: https://code.wireshark.org/review/9228
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03 23:37:18 +00:00
Micha Reiser afe07a9b09 - Mark some DCE/RPC functions as public do allow calls from plugins
- DCOM:
 	* Mark some DCOM functions as public do allow calls from plugins
	* Add Support for Additional Variant Types  Money, I8, UI8
	* Fix an uint32 overflow when dissecting nwstringz0 where the length is 0
	* Use WS_DLL_PUBLIC instead of WS_DLL_PUBLIC_DEF

Change-Id: I02861a09203c6b42326f5a7b7e652e0f7c26d369
Reviewed-on: https://code.wireshark.org/review/8222
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-29 12:52:10 +00:00
Michael Mann aeb9827e4a Convert proto_tree_add_boolean to proto_tree_add_bitmask_[value|value_with_flags|list]
Part 1 of a few

Change-Id: I413f23dfa92da5488ca8a7f62ca0738b25004635
Reviewed-on: https://code.wireshark.org/review/8117
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-18 16:32:27 +00:00
Guy Harris 499d95964d Eliminate e_uuid_t in favor of e_guid_t.
That eliminates a redundant and confusing data type, and avoids issues
with one piece of code using e_uuid_t but wanting to use routines
expecting an e_guid_t.

Change-Id: I95e172d46d342ab40f6254300ecbd2a0530cde60
Reviewed-on: https://code.wireshark.org/review/7506
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-03 10:55:29 +00:00
Bill Meier 0cd2582e8d Prevent two false positive MSVC2013 Code Analysis warnings
Message: "Using uninitialized memory"

Change-Id: Ib7d381beb9f9c1f3ec19a376c0c8c0d5ef85f373
Reviewed-on: https://code.wireshark.org/review/7069
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-02-11 17:10:12 +00:00
Michael Mann e530c89940 Replace se alloced memory in compare stat tap.
Also replaced comments mentioning se_alloc memory with wmem_file_scope, since it's more accurate.

It seems that many of the TShark stat taps may be leaking memory, because the hash tables created by the taps don't get a chance to be freed.  Somewhat academic since TShark exits shortly after displaying any stats, but a leak none the less.

Change-Id: I8ceecbd00d65b3442dc02d720b39c2e15aa0c8a6
Reviewed-on: https://code.wireshark.org/review/6557
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-16 00:37:02 +00:00
Michael Mann 3d3f97320b Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71
Reviewed-on: https://code.wireshark.org/review/5934
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26 21:17:10 +00:00
Bill Meier b68fb9b659 Fix some dissectors doing termio (fprintf(stderr,..), g_warning()).
- Use report_...failure() (in most cases).
- Also: Do some misc fixes in certain disectors
  - re-arrange order of #includes
  - Fixup preferences help text

Change-Id: I385f6f97257f365f53ce611df02f57f9257dc5f9
Reviewed-on: https://code.wireshark.org/review/6039
Petri-Dish: Bill Meier <wmeier@newsguy.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26 20:55:25 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
Guy Harris 0b9eb9f4b7 Get rid of unnecessary includes of ctype.h.
Change-Id: I2cf49f808558147ce77e7d086558966cfb2defca
Reviewed-on: https://code.wireshark.org/review/4850
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-20 06:02:51 +00:00
Bill Meier 482e8e5651 Add editor modelines & adjust indentation/whitespace as needed.
Change-Id: Ice2d93632cd42dfcef3bfbf0e15f2a8a147278fc
Reviewed-on: https://code.wireshark.org/review/4433
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-02 22:30:52 +00:00
Guy Harris 5bfc21cf9e Clean up handling of missing functions.
With autotools, CMake, and nmake, if we have a function, #define
HAVE_{function_name_in_all_caps}, otherwise don't #define it.

If we provide our own version of a function in libwsutil, make sure we
have a header that declares it, and *ONLY* include that header if
HAVE_{function_name_in_all_caps} is *NOT* defined, so that we don't have
the system declaration and our declaration colliding.

Check for inet_aton, strncasecmp, and strptime with CMake, just as we do
with autotools.

Simplify the addition of {function_name_in_all_caps}_LO to libwsutil in
autotools.

Change-Id: Id5be5c73f79f81919a3a865324e400eca7b88889
Reviewed-on: https://code.wireshark.org/review/2903
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 21:03:09 +00:00
Guy Harris d3df2e588b On UN*X, <arpa/inet.h> suffices for struct in_addr and in_addr_t.
So don't pull in <netinet/in.h>.  Also, avoid <sys/types.h> in
packet-dcom.c.

While we're at it, do *not* assume that pinfo->src or pinfo->dst are
IPv4 addresses.

Change-Id: I5fc8e859780a8d863aaf6e90a21a7039cabae0e6
Reviewed-on: https://code.wireshark.org/review/1006
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-08 08:23:34 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Jakub Zawadzki 746ee39329 Drop isprint.h use g_ascii_isprint() when this include hack was enabled.
svn path=/trunk/; revision=54327
2013-12-21 15:01:45 +00:00
Anders Broman e8b935ad6e Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54209
2013-12-18 06:51:09 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Michael Mann 22760b2d2a Remove pinfo->private_data from DCERPC dissectors and instead have dcerpc_info* infomation be passed in as a function parameter. Bug 9387 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9387)
All "generated" source was manually modified (with the power of search/replace), but I believe the "source input" files have been adjusted (checked into revs 53098 and 53099) to reflect the necessary changes (with possible whitespace formatting differences).

The Microsoft compiler doesn't flag "unused function parameters", so I apologize in advance if I may have missed a few.  The "dcerpc_info* di" parameter is used in almost every function.

svn path=/trunk/; revision=53100
2013-11-06 14:31:29 +00:00
Bill Meier 9874da2fcb #if 0 numerous "unused const variables" (mostly value-string-arrays);
Also; fix a few "set but not used" warnings.

svn path=/trunk/; revision=52780
2013-10-23 06:29:11 +00:00
Pascal Quantin 074349264e Convert some dissectors to wmem (leaving uat-like memory with emem for now)
svn path=/trunk/; revision=52031
2013-09-14 10:53:29 +00:00
Michael Mann 9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Michael Mann 2d37ec3cb0 Batch of filterable expert infos.
svn path=/trunk/; revision=49853
2013-06-09 03:28:05 +00:00
Anders Broman 263a9d0683 [-Wmissing-prototypes]
Use explicit casts.

svn path=/trunk/; revision=48341
2013-03-16 16:25:41 +00:00
Bill Meier 96a24cc79f Fix spelling/typos found using a list of commonly misspelled words.
The misspellings were mostly in comments but some were
in text strings visible to the user.


svn path=/trunk/; revision=47899
2013-02-26 04:42:26 +00:00
Bill Meier 1823aa007c it's ==> its & its ==> it's as needed.
svn path=/trunk/; revision=47891
2013-02-26 01:06:19 +00:00
Bill Meier c439b805e2 Comment out unused hf[] entries & etc.
(found by checkhf)

svn path=/trunk/; revision=47389
2013-01-31 17:55:31 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Evan Huus ae3ff16465 Fix C++-style comment caught by checkAPI.
svn path=/trunk/; revision=44725
2012-09-01 13:02:14 +00:00
Anders Broman c44a7fba0d From Litao Gao:
Implementation of IRemoteSCMActivator::RemoteCreateInstance and some minor bug fix

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

svn path=/trunk/; revision=44721
2012-09-01 11:22:29 +00:00
Bill Meier 638d74d43f Use val_to_str_const() where appropriate;
Also (for a few files):
- create/use some extended value strings;
- remove unneeded #include files;
- remove unneeded variable initialization;
- re-order fcns slightly so prefs_reg_handoff...() at end, etc

svn path=/trunk/; revision=44438
2012-08-10 22:55:02 +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
Gerald Combs bdb614e264 Fix a bunch of uninitialized variables found by Coverity Scan. CIDs
702403, 702404, 702405, 702406, 702407, 702408, 702409, 702410, 702411,
and 702412.

svn path=/trunk/; revision=42658
2012-05-16 16:29:12 +00:00
Bill Meier 2fef9f460f Don't use tabs in string constants;
svn path=/trunk/; revision=42357
2012-04-30 19:55:24 +00:00
Bill Meier f0c3ee5c4a Whitespace cleanup: Indentation, trailing, ...
svn path=/trunk/; revision=42266
2012-04-26 16:05:05 +00:00
Bill Meier 94f36ca4ff Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
   FT_BYTES
   FT_IPV6
   FT_IPXNET
   FT_OID

Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39260
2011-10-04 22:44:31 +00:00
Anders Broman ab901be153 Get rid of check_col, while at it set ENC.
svn path=/trunk/; revision=39148
2011-09-26 11:33:10 +00:00
Jeff Morriss 339136d1d0 Based on patch from Denis Ovsienko via
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6244 :

Fix typo: s/unkown/unknown/

svn path=/trunk/; revision=38561
2011-08-16 13:16:33 +00:00
Guy Harris c34b796445 Add a DREP_LITTLE_ENDIAN for the DCE RPC endianness bit in the data
representation.  Use it rather than a raw 0x10.

Add a DREP_ENC_INTEGER() macro that takes a pointer to the data
representation and returns either ENC_LITTLE_ENDIAN or ENC_BIG_ENDIAN;
use it for the encoding argument to proto_tree_add_item(), rather than
just the AND of drep[0] and DREP_LITTLE_ENDIAN, as it's not a boolean
any more, and for string values we'll be supporting character encodings
as well and thus won't be able to trust that the 0x10 bit will mean
"little endian".

Use ENC_NA for some other encoding values, i.e. for FT_BYTES and the
like.

Fix a couple of places in the DCOM dissector where we were passing the
byte-order bit rather than the field value to
proto_tree_add_uint_format().

Clean up white space.

svn path=/trunk/; revision=38128
2011-07-19 23:02:02 +00:00
Gerald Combs b223e99e5a get_host_ipaddr() was returning numeric addresses in host byte order
and hostnames in network byte order. Have it return everything in
network byte order.

svn path=/trunk/; revision=36873
2011-04-26 17:13:37 +00:00
Jeff Morriss 067a076179 Use tvb_ip_to_str().
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()s to ensure the
return string is NULL terminated.

svn path=/trunk/; revision=35545
2011-01-16 03:29:03 +00:00
Jeff Morriss 47e2d75820 Move some code (including the optional objects) into libwsutil
svn path=/trunk/; revision=33012
2010-05-28 20:19:55 +00:00
Jeff Morriss 0eb841fdf7 Fix the fuzz failure found in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4685 :

Don't store pointers to g_malloc()'d memory (in this case GLists) in
se_alloc()'d memory: the se_alloc()'d memory is freed before the reinit
functions are called so it's no longer safe to use.

svn path=/trunk/; revision=32490
2010-04-16 14:48:30 +00:00
Bill Meier 9a3b1a78d1 Fix some memory leaks; Fix some indentation.
This is a re-submission of SVN #31838 this time
properly using g_list_free() instead of g_free().

svn path=/trunk/; revision=31848
2010-02-09 17:48:41 +00:00
Bill Meier 9fc016d8b9 Revert SVN #31838; It's NG.
svn path=/trunk/; revision=31847
2010-02-09 14:43:30 +00:00
Bill Meier b3be21c93b Fix some memory leaks; Fix some indentation.
svn path=/trunk/; revision=31838
2010-02-08 23:45:10 +00:00
Stig Bjørlykke e9977dda66 Removed an unused variable.
svn path=/trunk/; revision=30880
2009-11-09 14:08:54 +00:00