Commit Graph

167 Commits

Author SHA1 Message Date
Anders Broman 2477298026 From Sean Van Gorder:
When Wireshark attempts to read an SNMP packet with a variable-bindings item
with an OID containing an index string which includes an entry of type
"Unsigned32", Wireshark will stop dissecting the packet at this index entry and
end with the error:

[Dissector bug, protocol SNMP: proto.c:2761: failed assertion
"DISSECTOR_ASSERT_NOT_REACHED"]

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

svn path=/trunk/; revision=37558
2011-06-05 20:12:44 +00:00
Alexis La Goutte ec7709406e Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=36771
2011-04-21 16:00:38 +00:00
Alexis La Goutte 7239db18ec Fix Dead Store (Dead nested assignment) Warning found by Clang
svn path=/trunk/; revision=36760
2011-04-21 13:34:22 +00:00
Stephen Fisher fcfcfa347c Rollback r36614 and change dissect_SMUX_PDUs_PDU() to use previously
unused smux_tree instead of tree.  Per suggestion from Stig on -dev.


svn path=/trunk/; revision=36624
2011-04-13 15:48:24 +00:00
Stephen Fisher 4b416d92d0 Fix Coverity 524: NEGATIVE_RETURNS
Coverity sees that two calls to tvb_length_remaining() with an offset
of 0 may return -1 (for an "out of bounds" condition), which would lead
to an assignment of -1 to an unsigned variable and then passing it
to functions further down that cannot accept negative values.

Use tvb_ensure_length_remaining() to throw an exception in a case of
out of bounds access (though unlikely with an offset of 0) instead of
tvb_length_remaining(), which would return -1.


svn path=/trunk/; revision=36615
2011-04-12 22:23:03 +00:00
Stephen Fisher ce2eea5b95 Fix Coverity 1047: UNUSED_VALUE in dissect_smux
svn path=/trunk/; revision=36614
2011-04-12 22:12:05 +00:00
Stig Bjørlykke 42f41ddf0b Corrected switch-case flow.
Coverity 1184.

svn path=/trunk/; revision=36579
2011-04-12 09:05:43 +00:00
Gerald Combs f989235a87 Use a unique variable name. Fixes Coverity CID 593.
svn path=/trunk/; revision=36512
2011-04-07 23:52:37 +00:00
Jeff Morriss cc6fc23812 From Didier via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3055 :
Apply rev 25869 to most of the rest of the TCP-desegmenting dissectors.
(The SSL dissector was already updated in one of two spots with bug 4535/rev
32456.)

A couple of the patches had to be manually applied.

From me: Fix the comments to match the change (including in the TCP and SSL
dissectors.)

svn path=/trunk/; revision=36332
2011-03-25 19:02:18 +00:00
Jaap Keuter 3ff6167958 Allow for expert items to be actually attached somewhere.
svn path=/trunk/; revision=35594
2011-01-20 08:58:03 +00:00
Stig Bjørlykke 011e451449 Only chop the last character (new line) from the error message.
svn path=/trunk/; revision=35310
2010-12-30 20:15:55 +00:00
Gerald Combs cf6df46095 Fix a buffer overflow in the engineId preferences. Fixes bug 5530.
svn path=/trunk/; revision=35298
2010-12-29 20:09:27 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Bill Meier 03b57df5a0 Fix various typos and spelling errors.
svn path=/trunk/; revision=35126
2010-12-06 01:34:58 +00:00
Stig Bjørlykke c5bebaa771 One more:
Make the third argument to a UAT copy callback a size_t.

svn path=/trunk/; revision=34696
2010-10-29 21:55:04 +00:00
Stig Bjørlykke 340d64e780 Make the third argument to a UAT copy callback a size_t.
svn path=/trunk/; revision=34695
2010-10-29 21:51:59 +00:00
Jeff Morriss ebc190645f From Fulko Hew via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4615 :
The attached patch adds the missing decoded fields
by moving the proto_tree_add_item() call so that it
is no longer within an error handler and will be
called under normal circumstances (as well as error conditions.


From me: Apply the change to the ASN.1 source.  Also some white space
indentation cleanup.

svn path=/trunk/; revision=34505
2010-10-14 01:44:27 +00:00
Jeff Morriss 9ac49c557d Copy the rev 34143 changes to packet-snmp.c over to the asn1 source.
hf_snmp_engineid_enterprise is now a BASE_EXT_STRING, not BASE_RANGE_STRING.  This fixes
the fuzz failure in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5233 

svn path=/trunk/; revision=34151
2010-09-17 14:03:05 +00:00
Stig Bjørlykke f3d2b22899 Mark encryptedData as unused, to avoid warnings when not HAVE_LIBGCRYPT.
svn path=/trunk/; revision=33691
2010-08-02 08:52:39 +00:00
Stig Bjørlykke 33099036fe Added missing include <string.h>.
svn path=/trunk/; revision=33690
2010-08-02 08:46:36 +00:00
Guy Harris 63a0810874 oid_encoded2string() returns a const char *; don't assign it to a char
*.

Don't declare variables in the middle of a block; not all the compilers
we use support that.

svn path=/trunk/; revision=33409
2010-07-02 03:50:30 +00:00
Gerald Combs ad7b7cc679 Don't add raw bytes to the tree.
svn path=/trunk/; revision=33403
2010-07-01 17:57:53 +00:00
Stig Bjørlykke 8246e87432 Moved register_ber_syntax_dissector() and register_ber_oid_syntax() from
proto_reg_handoff_* to proto_register_*.

svn path=/trunk/; revision=33345
2010-06-28 10:34:15 +00:00
Stig Bjørlykke 3f9a94d773 Avoid crash when adding SNMP Users.
This fixes bug 4926.

svn path=/trunk/; revision=33329
2010-06-26 12:00:08 +00:00
Guy Harris 927b7da346 Have abs_time_to_str() and abs_time_to_str_secs() take an additional
argument indicating whether to include the time zone in the string.  If
we're constructing a display filter, don't include the time zone,
otherwise do.  Fixes bug 4756.

svn path=/trunk/; revision=32913
2010-05-21 06:33:25 +00:00
Stig Bjørlykke 8ef65daa69 Don't type prune the data_ptr pointer for UAT.
svn path=/trunk/; revision=32628
2010-05-02 13:50:19 +00:00
Bill Meier 9ade30a7b1 #include <string.h> and/or #include <stdio.h> not needed.
svn path=/trunk/; revision=32417
2010-04-07 16:54:29 +00:00
Jaap Keuter 60e215982e Fix for bug 4551.
Add type to engine ID MAC Address format for Cisco agent/manager.

svn path=/trunk/; revision=32125
2010-03-05 20:09:37 +00:00
Anders Broman 130d309444 from Luis Ontanon:
calculate the value of a ber integer by hand instead of just using
proto_tree_add_item().
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3230

svn path=/trunk/; revision=32113
2010-03-04 13:54:21 +00:00
Stig Bjørlykke 2f8830b4d0 From LEGO via bug 3459:
Add a callback to UAT to be called after the table has being updated,
use it to renew the snmp_ue_cache.

svn path=/trunk/; revision=32112
2010-03-04 12:50:18 +00:00
Anders Broman c4d69e4453 From Luis Ontanon:
Check for duplicate entries in usmUserTable.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2426

svn path=/trunk/; revision=32081
2010-03-02 05:44:04 +00:00
Guy Harris 500eb99cd9 Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with the
date as YYYY/DDD, where DDD is a 1-origin day of year.  Move the formats
to a "time_fmt.h" file, included by the headers that use it.  Have
abs_time_to_str() and abs_time_secs_to_str() take the date format value,
rather than a Boolean "show this as UTC" flag, as an argument.  Document
the ABSOLUTE_TIME_ formats a bit better.  Use that format in the CCSDS
and VCDU dissectors, rather than having those dissectors do the
formatting themselves.

svn path=/trunk/; revision=32034
2010-02-27 19:01:27 +00:00
Gerald Combs 8fc1491a60 Switch to using a bundled version of the openSUSE Build Service packages
for GNUTLS since they provide 32-bit and 64-bit Windows packages. We no
longer have winposixtype.h, so remove its #includes and add a ssize_t
typedef to config.h.win32.

svn path=/trunk/; revision=31341
2009-12-21 21:06:01 +00:00
Guy Harris 8e236e55de For fields of type FT_ABSOLUTE_TIME, have the "display" value be one of
ABSOLUTE_TIME_LOCAL or ABSOLUTE_TIME_UTC, indicating whether to display
the date/time in local time or UTC. (int)ABSOLUTE_TIME_LOCAL ==
(int)BASE_NONE, so there's no source or binary compatiblity issue,
although we might want to eliminate BASE_NONE at some point and have the
BASE_ values used with integral types start at 0, so that you can't
specify BASE_NONE for an integral field.

svn path=/trunk/; revision=31319
2009-12-19 03:17:44 +00:00
Guy Harris 4fde145bd2 Add an argument to abs_time_to_str() and abs_time_secs_to_str()
indicating whether the time should be shown as local time or UTC.  For
now, always pass FALSE, meaning "show as local time".

Clean up some stuff in the SNMP dissector, use abs_time_secs_to_str()
for times with one-second resolution, and update a comment in various
macros in the WSP dissector, while we're at it.

svn path=/trunk/; revision=31227
2009-12-10 22:19:29 +00:00
Stig Bjørlykke 00d20e0384 Made enterprise_oid pointer const.
svn path=/trunk/; revision=30877
2009-11-09 13:03:15 +00:00
Stig Bjørlykke 169547006b Remove an unused variable.
svn path=/trunk/; revision=30876
2009-11-09 12:38:47 +00:00
Stig Bjørlykke bbc109d1b6 Added some type renames.
svn path=/trunk/; revision=30798
2009-11-01 19:16:57 +00:00
Stig Bjørlykke 5c62502644 Added a UAT table to describe enterprise specific-trap types.
svn path=/trunk/; revision=30796
2009-11-01 18:45:43 +00:00
Stig Bjørlykke 55f080c9c8 Added SNMP to "Decode ASN.1 file as" list.
svn path=/trunk/; revision=30766
2009-10-30 10:05:28 +00:00
Kovarththanan Rajaratnam 7ab993bee7 Remove unused NEED_PACKET_PROTO_H variable
svn path=/trunk/; revision=30409
2009-10-08 17:26:57 +00:00
Stig Bjørlykke 01668de485 Fixed offset_from_real_beginning() -> tvb_offset_from_real_beginning()
svn path=/trunk/; revision=30349
2009-10-05 21:39:47 +00:00
Stig Bjørlykke 902a1013a4 Return from dissect_snmp_VarBind() when detecting invalid oid.
svn path=/trunk/; revision=30348
2009-10-05 21:39:07 +00:00
Kovarththanan Rajaratnam b97cfa22fd offset_from_real_beginning() is only called with 0 as second argument, so remove the argument completely. It seems that the second argument only acts as an accumulator allowing offset_from_real_beginning() to call itself recursively. To be consistent offset_from_real_beginning() is renamed to tvb_offset_from_real_beginning().
svn path=/trunk/; revision=29844
2009-09-10 16:54:02 +00:00
Kovarththanan Rajaratnam c19f7978db Sanitize epan includes
svn path=/trunk/; revision=29500
2009-08-21 20:32:50 +00:00
Kovarththanan Rajaratnam 8b515e9340 Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
2009-08-16 12:36:22 +00:00
Kovarththanan Rajaratnam 083729e02c Add PTREE_FINFO and use PITEM_FINFO when possible.
svn path=/trunk/; revision=29355
2009-08-09 17:57:31 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00
Gerald Combs 7cf4114654 If we have a format error, don't try adding something to the
tree. Fixes bug 3822.

svn path=/trunk/; revision=29331
2009-08-08 00:27:31 +00:00
Gerald Combs 517d9cec5f Don't crash if we happen to load a bad MIB file.
svn path=/trunk/; revision=29118
2009-07-16 17:00:58 +00:00