Commit Graph

50965 Commits

Author SHA1 Message Date
Gerald Combs 465e4664de Use "(void) <variable/>" to avoid unused variable warnings similar to
Qt's Q_UNUSED macro.

svn path=/trunk/; revision=54110
2013-12-14 23:44:25 +00:00
Jakub Zawadzki 62d05c80ff Fix some warnings
svn path=/trunk/; revision=54109
2013-12-14 22:07:26 +00:00
Jakub Zawadzki 4120d74965 sock diag netlink: dissect requests, stub for 'padding dissection'.
svn path=/trunk/; revision=54108
2013-12-14 21:04:49 +00:00
Bill Meier defd185efa Rework code slightly to prevent VS Code Analysis warning:
C6326: Potential comparison of a constant with another constant

svn path=/trunk/; revision=54107
2013-12-14 19:26:06 +00:00
Gerald Combs 02eea9378e More shorten-64-to-32 warnings.
svn path=/trunk/; revision=54106
2013-12-14 19:23:34 +00:00
Guy Harris 478f83dd2a Use proto_tree_add_item() rather than fetching a string an adding it, if
possible.  If (possibly) not possible, use tvb_get_string_enc() rather
than tvb_get_unicode_string().

svn path=/trunk/; revision=54105
2013-12-14 19:11:21 +00:00
Bill Meier 81a67cec58 Fix (I think) VS Code Analyzer warnings:
C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value.
   Results might not be an expected value


svn path=/trunk/; revision=54104
2013-12-14 18:50:23 +00:00
Bill Meier 3ddb2011f9 Create/use several extended value-strings;
(Sort & remove dups from underlying value_string arrays);
Reformat a few long lines;
Add editor modelines;


svn path=/trunk/; revision=54103
2013-12-14 18:33:55 +00:00
Bill Meier 1190f52ecb Fix VS Code Analysis warning:
C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. \
  Results might not be an expected value

'offset++' --> 'offset += 1' for consistency;
Add/adjust whitespace;
Add editor modelines


svn path=/trunk/; revision=54102
2013-12-14 18:25:42 +00:00
Gerald Combs 75f1073fe6 Cast away shorten-64-to-32 warnings.
svn path=/trunk/; revision=54101
2013-12-14 18:12:32 +00:00
Gerald Combs 8fde85216a Squelch a bunch of shorten-64-to-32 warnings by parsing all of our
numeric values using strtoul and casting it the result to a guint32.
Hopefully no user or session IDs are negative or greater than 32 bits.

svn path=/trunk/; revision=54100
2013-12-14 18:07:01 +00:00
Bill Meier c729725ab6 Fix bug found by VS Code Analysis:
warning C6385: Invalid data: accessing 'tag_to_type', \
 the readable size is '136' bytes, but '140' might be read

svn path=/trunk/; revision=54099
2013-12-14 17:00:56 +00:00
Chris Maynard 862b30c07a Take a preemptive strike at some likely future VS Code Analyzer warnings about strings possibly not being zero-terminated.
svn path=/trunk/; revision=54098
2013-12-14 17:00:36 +00:00
Jakub Zawadzki 07a8d1b55a xmpp_attr_info, xmpp_attr_info_ext: Pass pointer to hf
This should fix most of warnings: 
	initializer element is not computable at load time

svn path=/trunk/; revision=54097
2013-12-14 16:47:52 +00:00
Bill Meier b4acad6f0f Prevent VS Code Analyzer warning; (AFAICT: not an actual bug).
svn path=/trunk/; revision=54096
2013-12-14 16:36:07 +00:00
Jakub Zawadzki 715e2d6699 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54095
2013-12-14 16:09:57 +00:00
Bill Meier 5a4720b28d Set Proto col & Clear Info col before fetching data from the tvb;
Almost all of the dissection code can be under 'if (tree)';
Do some whitespace changes.

svn path=/trunk/; revision=54094
2013-12-14 16:01:00 +00:00
Evan Huus aa1649416b Add a cast to silence an unnecessary warning.
svn path=/trunk/; revision=54093
2013-12-14 14:44:52 +00:00
Jakub Zawadzki e0e86bab5a Fix const warnings.
svn path=/trunk/; revision=54092
2013-12-14 14:33:46 +00:00
Evan Huus 2754c08d93 From Peter Paluch via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9158
Currently, the LLC dissector in packet-llc.c displays the values of DSAP IG bit
and SSAP CR bit as separate items in the proto tree. This gives an impression
that these entries are separate fields in the LLC header while in reality, they
are only the least significant bits in DSAP/SSAP octets. In addition, the
importance of these bits is relatively low in today's LLC-based protocols (they
are mostly set to 0), so having them always displayed in the proto tree is
somewhat of a luxury.

Modify the LLC dissector by having added a subtree to both DSAP and SSAP items
that displays the IG and CR bits as bits in a bitfield, and moved the display
of IG and CR bits into these subtrees.

It may seem that adding a text item instead of a FT_UINT8 value is not a
sensible approach because such item is not filterable. However, if filtering by
the entire DSAP/SSAP value (which is the typical way of filtering on SAPs), this
value is always added to the tree in its entirety and indexed by "llc.dsap" and
"llc.ssap" filter strings. If the GI or CR bit are to be matched, "llc.dsap.ig"
and "llc.ssap.cr" filter strings are available. Searching for the value of the
DSAP/SSAP & 0xFE which would be the value currently added by the
proto_tree_add_text() is not done and should not be done, as IEEE stipulates:
"An individual actual address value does not necessarily have any relationship
with a group address of the same actual address value."
(http://standards.ieee.org/develop/regauth/tut/llc.pdf) Following this
consideration, the choice of displaying the SAP "actual address" using
proto_tree_add_text() is acceptable.

svn path=/trunk/; revision=54091
2013-12-14 14:11:30 +00:00
Jakub Zawadzki a990dfa454 rdp_field_info_t struct: Pass pointer to hf
This should fix most of errors:
  warning: initializer element is not computable at load time [enabled by default]

svn path=/trunk/; revision=54090
2013-12-14 13:36:54 +00:00
Jakub Zawadzki 1053e722ed Fix warnings
svn path=/trunk/; revision=54089
2013-12-14 12:45:57 +00:00
Jakub Zawadzki 4d92f6079b Remove not needed ';'
svn path=/trunk/; revision=54088
2013-12-14 11:12:20 +00:00
Jakub Zawadzki fde0410bb5 Fix constiness of GET_VALSP() macro.
svn path=/trunk/; revision=54087
2013-12-14 11:03:16 +00:00
Jakub Zawadzki 53f438b4ed Allow -Wmissing-prototypes only for C
It should fix:
	cc1plus: warning: command line option `-Wmissing-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default]

(only g++ complains, clang is OK with -Wmissing-prototypes)

svn path=/trunk/; revision=54086
2013-12-14 10:43:29 +00:00
Jakub Zawadzki 5c79cbf152 Fix some trivial warnings.
svn path=/trunk/; revision=54085
2013-12-14 10:29:26 +00:00
Guy Harris 5dd7b7388b Use proto_tree_add_item() for UTF-16 strings when dissecting string
descriptors.

Make sure the length in string descriptors is at least 2, so that we
have a valid string or string-list length.

svn path=/trunk/; revision=54084
2013-12-14 03:44:12 +00:00
Evan Huus e57d150ec9 Fix string length typo causing unitialized-value warnings caught by valgrind
fuzzing.

svn path=/trunk/; revision=54083
2013-12-14 01:40:39 +00:00
Evan Huus cb73c3710b It seems sscanf requires the input string to be null-terminated, even if it is
longer than the maximum possible amount to read based on the format string. For
this reason, don't use sscanf on tvb_get_ptr directly, copy and null-terminate
the bytes we want.

Fixes an uninitialized value caught by valgrind fuzzing.

svn path=/trunk/; revision=54082
2013-12-14 01:34:02 +00:00
Gerald Combs 2f11c8f1ff Add a bunch of tooltips.
svn path=/trunk/; revision=54081
2013-12-14 00:07:27 +00:00
Guy Harris 0510eeb0cb Pass the information from ATP to the conversation dissector.
svn path=/trunk/; revision=54080
2013-12-13 23:32:00 +00:00
Jakub Zawadzki 8a3191f8e0 It should halve warnings count in tn5250 dissector.
svn path=/trunk/; revision=54079
2013-12-13 23:22:28 +00:00
Jakub Zawadzki d6da7a01b1 Fix warnings + remove some v. old comment from strutil.h
svn path=/trunk/; revision=54078
2013-12-13 23:11:14 +00:00
Evan Huus 24360c9951 Make sure all unused bits are 0 in bacapp, fixes uninitialized memory found by
valgrind.

svn path=/trunk/; revision=54077
2013-12-13 23:08:32 +00:00
Guy Harris 4043db5865 Rename spotlight_get_utf16_string_encoding() to
spotlight_get_utf16_string_byte_order(), and have it return
ENC_BIG_ENDIAN or ENC_LITTLE_ENDIAN if it finds a BOM and 0xFFFFFFFF if
it doesn't, to make it a bit clearer what it's doing.

Use tvb_get_string_enc() rather than tvb_get_unicode_string().

svn path=/trunk/; revision=54075
2013-12-13 22:44:58 +00:00
Guy Harris 30ab019f2b In tvb_get_unicode_string(), if the byte count is odd, ignore the last
byte.  (We should perhaps add an expert info indication in those cases.)

svn path=/trunk/; revision=54074
2013-12-13 22:35:50 +00:00
Jakub Zawadzki bbc3e14642 netlink: update
- set pinfo->p2p_dir based on portid
- check for nlmsg type in dissect_netlink_sock_diag()
- sock diag support LINUX_AF_INET6, LINUX_AF_PACKET
- naming cleanup 

svn path=/trunk/; revision=54073
2013-12-13 22:34:10 +00:00
Evan Huus 4cb6a92d93 Change the exit status of a fuzz failure to 255 so that if you use it with xargs
the failures don't get suppressed.

svn path=/trunk/; revision=54071
2013-12-13 22:15:29 +00:00
Guy Harris 2d5c1c8689 Note that apparently some BACnet implementations misuse the "ANSI X3.4"
encoding for ISO 8859-1; this means that those strings won't be
correctly interpreted if they're interpreted as UTF-8.

svn path=/trunk/; revision=54069
2013-12-13 21:36:50 +00:00
Gerald Combs fde7a4c263 Simplify column sizing.
svn path=/trunk/; revision=54068
2013-12-13 21:31:01 +00:00
Bill Meier 9d21f521fe Fix various issues:
- Display of header bit fields was incorrect;
- Computation of the data length was incorrect;
- Display of trailer 'indicator enable' & 'indicator' bit fields was incorrect;
- 'Display' field of certain hf[] entries was incorrect.
- Pedantic: Use ENC_BIG_ENDIAN instead of ENC_NA in certain places.

See Bug #9539

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


svn path=/trunk/; revision=54067
2013-12-13 21:30:25 +00:00
Evan Huus 34b93ed41e Replace wmem_alloc with wmem_new in a few places, and wmem_new with wmem_new0 in
a few places to avoid uninitialized memory found while fuzz-testing with
valgrind.

svn path=/trunk/; revision=54066
2013-12-13 21:26:59 +00:00
Chris Maynard 0905bffaa5 Return FALSE from dissect_iwarp_mpa() if data is NULL. Note that this is the conservative/safest approach since there do appear to be some code paths that don't rely on the data.
svn path=/trunk/; revision=54065
2013-12-13 21:25:48 +00:00
Chris Maynard 7aaa0b2a27 Return FALSE from dissect_zbee_nwk_heur() if data is NULL.
svn path=/trunk/; revision=54064
2013-12-13 21:15:49 +00:00
Chris Maynard 629c13c51d Add data arg to dissect_wassp_heur() in case it's ever used.
svn path=/trunk/; revision=54063
2013-12-13 21:08:21 +00:00
Chris Maynard 7ba2ee5d6e Return FALSE from dissect_tapa_heur() if data is NULL.
svn path=/trunk/; revision=54062
2013-12-13 20:59:45 +00:00
Chris Maynard 305055b829 Add data arg to dissect_skype_heur() so it compiles cleanly if/when SKYPE_HEUR is ever defined.
svn path=/trunk/; revision=54061
2013-12-13 20:50:19 +00:00
Guy Harris cbeaa89644 Handle NFS4_OP_ILLEGAL (and other potential array bounds errors).
svn path=/trunk/; revision=54058
2013-12-13 20:31:02 +00:00
Chris Maynard c88431cbb0 Remove _U_
svn path=/trunk/; revision=54057
2013-12-13 20:16:53 +00:00
Evan Huus 4b6ef3fac2 Add another check to radiotap-iter initialization to catch another out-of-bounds
read found while fuzzing with valgrind. Hopefully doesn't break valid captures.

svn path=/trunk/; revision=54056
2013-12-13 20:09:17 +00:00