Commit Graph

72 Commits

Author SHA1 Message Date
Michael Mann cf80442912 Convert some proto_tree_add_string_format calls to something more appropriate.
There seem to be several cases of proto_tree_add_string_format where a "string" value/filter doesn't really make sense because it's always empty, and is just being used as a "filterable subtree header (placeholder)".  They appear to be more for "presense" than "value" and should probably be FT_NONE, although I'd almost argue for removing the filter in favor of  proto_tree_add_text.

svn path=/trunk/; revision=52296
2013-09-30 15:21:09 +00:00
Michael Mann b38ee917b1 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly.
The script didn't catch as many as I would have liked, but it's a start.

The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum.

svn path=/trunk/; revision=52045
2013-09-15 01:48:30 +00:00
Evan Huus d6d4c069d9 Replace some emem with wmem.
The windows-common dissector seems to make excessive use of strbufs - I
converted them and simplified a bit, but it could probably be simplified more.

svn path=/trunk/; revision=52008
2013-09-13 17:14:55 +00:00
Guy Harris 6b629c4d92 Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c.  Update their callers to include
<epan/show_exception.h> to get their declaration.

Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff.  Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).

Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).

Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.

Use show_exception() to report non-fatal errors, rather than doing it
yourself.
 
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.

Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.

Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.

svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
Alexis La Goutte c6ff7f75ea Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=47424
2013-02-01 16:36:37 +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
Bill Meier cf706ca547 From Stefan Metzmacher: Updates for the SMB2/3
This patches add some missing things for SMB2/3 and support for decryption
of SMB3 traffic

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

From me: Change an initializer from C99 to C89 style (since the
 Microsoft compiler doesn't support C99).

svn path=/trunk/; revision=44542
2012-08-16 17:03:07 +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
Jeff Morriss a66eee919e Mark a couple more variables volatile.
svn path=/trunk/; revision=43437
2012-06-21 21:19:48 +00:00
Jeff Morriss 7a18a5e7b9 From Richard Sharpe via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7387 :
Don't break/return out of a TRY/CATCH.

svn path=/trunk/; revision=43434
2012-06-21 19:32:56 +00:00
Jeff Morriss adb2a47a58 Mark another variable as volatile to pacify the buildbot.
svn path=/trunk/; revision=43376
2012-06-19 17:29:56 +00:00
Jeff Morriss f39c0913ed Mark some variables as volatile to avoid compiler warnings.
svn path=/trunk/; revision=43357
2012-06-19 13:24:43 +00:00
Anders Broman f0f3e36bda Try to fix unused variable warnings and "clobbered by 'longjmp' or 'vfork' "
svn path=/trunk/; revision=43355
2012-06-19 12:44:13 +00:00
Anders Broman 9ee8562c32 From Richard Sharpe:
Wireshark is unable to dissect Security Descriptors that span TCP segments where some are not captured or reassembled

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

svn path=/trunk/; revision=43352
2012-06-19 10:30:51 +00:00
Jakub Zawadzki ac5c40e6c5 Mark some function static.
svn path=/trunk/; revision=41999
2012-04-09 19:43:19 +00:00
Bill Meier 4748747a51 Fix a few proto_tree_add_item() encoding args.
svn path=/trunk/; revision=39519
2011-10-23 18:48:50 +00:00
Bill Meier 67ee5049d4 Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
  the encoding parameter for proto_tree_add_item() calls which directly reference
  an item in hf[] which has a type of:
     FT_BOOLEAN
     FT_IPv4
     FT_EUI64
     FT_GUID
     FT_UINT_STRING

Also: For type FT_ITv6 use ENC_NA. (This was missed in SVN #39260)

svn path=/trunk/; revision=39328
2011-10-10 00:39:31 +00:00
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +00:00
Alexis La Goutte 5147a51e3a From Gregor Beck via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6004
dissect_nt_v2_ace: doesn't support ace type > 8

svn path=/trunk/; revision=37692
2011-06-17 12:28:21 +00:00
Jeff Morriss 278caa12d9 Fix some (value) mistakes in value_strings. Found by Martin's patch on the -dev list.
svn path=/trunk/; revision=37262
2011-05-18 21:07:59 +00:00
Chris Maynard 0ea2cd66e7 Delete assignment of item as it's not used. Fixes Coverity CID 869.
svn path=/trunk/; revision=37131
2011-05-13 19:15:21 +00:00
Stig Bjørlykke 27344a90fe Removed some unneeded assignments.
Found by clang.

svn path=/trunk/; revision=36698
2011-04-18 15:29:25 +00:00
Anders Broman d75443b02c packet-windows-common.c:1492: warning: 'wkwn_sid2_len' may be used uninitialized in this function
svn path=/trunk/; revision=35648
2011-01-25 15:34:52 +00:00
Anders Broman c2202875d1 Fix:
Error: the blurb for field "Well-known SID" ("nt.sid.wkwn") matches the field name in packet-windows-common.c

svn path=/trunk/; revision=35647
2011-01-25 15:33:36 +00:00
Anders Broman 3605d892f0 From Cal Turney:
Enhancements to SID dissection.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5613

svn path=/trunk/; revision=35643
2011-01-25 13:53:35 +00:00
Jeff Morriss 9d007f19f1 From Yaniv Kaul via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5372 :
Fix crash in LDAP dissector, in a generic way (for all callers of
dissect_nt_sid()).

svn path=/trunk/; revision=35127
2010-12-06 15:57:39 +00:00
Jeff Morriss 8c7c46d0fc Remove trailing space in field name.
svn path=/trunk/; revision=34639
2010-10-25 00:57:41 +00:00
Stig Bjørlykke 14d908de38 Corrected check for end of well_known_sids.
This fixes bug 5328.

svn path=/trunk/; revision=34619
2010-10-22 10:48:14 +00:00
Stig Bjørlykke efd9c3e0c9 Fixed printing guint64 variables.
Removed unused variables.

svn path=/trunk/; revision=34617
2010-10-22 06:42:55 +00:00
Anders Broman e64d2d99c0 C++ style comments in packet-windows-common.c
svn path=/trunk/; revision=34616
2010-10-22 06:26:42 +00:00
Anders Broman 9c9db7d4d4 From CaL Turney:
Add support for well-known SIDs/RIDs and option to display in hex.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5286

svn path=/trunk/; revision=34613
2010-10-22 05:15:25 +00:00
Bill Meier 066ba23f0b Fix some gcc -Wshadow warnings
svn path=/trunk/; revision=31673
2010-01-26 01:00:15 +00:00
Gerald Combs 9a35ed601d Remove more unused variables.
svn path=/trunk/; revision=29249
2009-07-30 23:47:36 +00:00
Stig Bjørlykke 4d8dd01e8e Changed flags_set_truth -> tfs_set_notset
svn path=/trunk/; revision=28989
2009-07-07 14:54:15 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Guy Harris 33ab682655 Use an emem_strbuf_t for the string for the subauthorities; it's a bit
cleaner, and also means that if there are no subauthorities we don't get
an uninitialized string.

svn path=/trunk/; revision=28272
2009-05-05 03:17:06 +00:00
Bill Meier 6d740b3d00 From: yami <yamisoe [AT] gmail.com>: Update comment in .c file; copy same to .h file
svn path=/trunk/; revision=27909
2009-03-31 11:59:59 +00:00
Bill Meier d6a5a7c761 P64 changes: Fix some cases for which size_t is not required
svn path=/trunk/; revision=27822
2009-03-22 20:55:31 +00:00
Ronnie Sahlberg b94c255167 the security info bitmask is 4 bytes, not 2
svn path=/trunk/; revision=26341
2008-10-03 02:48:52 +00:00
Ronnie Sahlberg 48cabe4f20 SAMR updates
svn path=/trunk/; revision=26340
2008-10-03 02:39:17 +00:00
Ronnie Sahlberg db3711d720 this error is returned in srvsvc when a SessDel fails because no matching session can be
found


svn path=/trunk/; revision=21823
2007-05-18 05:25:31 +00:00
Ronnie Sahlberg c6addcd89f add a new dos error code
svn path=/trunk/; revision=21809
2007-05-17 01:19:26 +00:00
Stephen Fisher 64cc1b407c From Sebastien Tandel:
(Fixing warnings)

stripped away some unused variables/parameters
+ in prefs.c
    suggestion of parentheses makes gcc happy


svn path=/trunk/; revision=21156
2007-03-23 18:45:21 +00:00
Ronnie Sahlberg 1b3847969e we did not have a proper WERR error table for the windows errors insterad we justkept adding the errors to the DOS error table (this merging does work ok since there is so very little overlap between he values in both ranges)
Add a new WERR error table to packet-windows-common    so that PIDL generated dissectors can use this table instead of the DOS table.


To make this table as complete and accurate as possible and to avoid having to type all the values in by hand    the table is generated from the samba doserr.h file and two small commandlines.
The commends in pakcet-windows-common.h explains how to regenerate the table from doserr.h






svn path=/trunk/; revision=19306
2006-09-23 21:55:40 +00:00
Ronnie Sahlberg 7bed417e5e make dissect_nt_sid return ep allocated memory and thus fix a few memory leaks
(this function is often called from dcerpc dissectors)


svn path=/trunk/; revision=19243
2006-09-16 09:20:34 +00:00
Ronnie Sahlberg 542380d974 fix for bug 1054
there were instances where the function dissect_nt_sid() would not fill in the return pointer for the sid string
causing callers that rely on that this string will ALWAYS be assigned try to access and g_free() an uninitialized pointer.

dissect_nt_sid() should be changed to use and return ep allocated memory instead of gmalloced memory



svn path=/trunk/; revision=19154
2006-09-05 15:13:39 +00:00
Guy Harris a9469ccb31 Squelch a compiler warning.
svn path=/trunk/; revision=18988
2006-08-21 23:23:22 +00:00
Ronnie Sahlberg c0e5ca30ad add some well known rids from s4 security.idl and code to show the name of this rid
when dissecting a security descriptor


svn path=/trunk/; revision=18959
2006-08-19 09:22:20 +00:00
Ronnie Sahlberg 23426c8901 add missing ace revision 4 and several new types some of which contain optional GUIDs
from samba4   security.idl


svn path=/trunk/; revision=18875
2006-08-10 13:21:57 +00:00