Commit Graph

47228 Commits

Author SHA1 Message Date
Jeff Morriss ee52f06db9 From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8877 :
In my last patch (bug #8847), I overlooked a place where I had to check for
the old CRC as well, which led to packages that were not detected anymore.

This 4 lines fix it. As usual, the patch was tested and works.

svn path=/trunk/; revision=50294
2013-07-01 14:20:17 +00:00
Jeff Morriss 97b4bbcab7 Revert r50287: the P1 dissector isn't clean yet ('dissect_p1_T_report_type' defined but not used)
svn path=/trunk/; revision=50293
2013-07-01 14:09:26 +00:00
Bill Meier 8d5bbb4146 Define certain 'const char *...' arrays as static.
Reduces code memory usage and execution time.
(See SVN #50271)


svn path=/trunk/; revision=50292
2013-07-01 13:03:23 +00:00
Michael Mann 59e46d816b Fix typo in retrieving h263 dissector. Bug 7893 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7893)
From Michal Labedzki

svn path=/trunk/; revision=50291
2013-07-01 11:55:48 +00:00
Jakub Zawadzki 7dc10daffe Rewrite hfinfo_numeric_value_format as a special case for _hfinfo_number_value_format
cleanup some functions.

svn path=/trunk/; revision=50290
2013-07-01 09:46:50 +00:00
Chris Maynard 6394e93dcb Fix Coverity CID 1025626 (Unintentional integer overflow) by declaring 1 as a 64-bit unsigned integer using G_GUINT64_CONSTANT().
svn path=/trunk/; revision=50289
2013-07-01 06:35:28 +00:00
Chris Maynard 997c6c7d8e Fix Coverity CID 712348 (Unused pointer value).
svn path=/trunk/; revision=50288
2013-07-01 06:15:37 +00:00
Guy Harris 48fdfdb9d3 packet-p1.c should now be clean.
svn path=/trunk/; revision=50287
2013-07-01 06:13:56 +00:00
Guy Harris 95daae2290 Squelch some warnings.
svn path=/trunk/; revision=50286
2013-07-01 06:13:21 +00:00
Chris Maynard 9a394ddfa0 Get rid of variable, 'end'.
svn path=/trunk/; revision=50285
2013-07-01 06:03:35 +00:00
Chris Maynard 8bfc3f6865 Return from dissect_at_command() immediately if tvb_length_remaining() returns -1.
svn path=/trunk/; revision=50284
2013-07-01 05:58:41 +00:00
Chris Maynard bfcaf93bff Fix Coverity CID 1040372 (Printf arg count mismatch) by eliminating the double %'s.
svn path=/trunk/; revision=50283
2013-07-01 05:47:13 +00:00
Chris Maynard 8976968f4c There are a few dissectors that pass the return value of tvb_length_remaining() as the size argument to the tvb_format_*() functions. Try to do something sane if that value happens to be -1 (or negative in general). One such example is packet-bthfp.c, as found and reported by Coverity in CID 1035325 (Improper use of negative value).
Note: There are other ways to handle this of course, but this fix is suitable for backporting to both 1.10 and 1.8, as it does not break binary compatibility.  Is there a better way to fix this though?  For now, schedule this for backport.

svn path=/trunk/; revision=50282
2013-07-01 05:23:17 +00:00
Chris Maynard b1197f177a Fix Coverity CID 1040636 (Out-of-bounds read) by changing the loop termination condition from "i < ZBEE_ZCL_NUM_ATTR_ETT" to "i < ZBEE_ZCL_APPL_CTRL_NUM_FUNC_ETT". The former is defined as 64 while the latter is defined as 32 and ett_zbee_zcl_appl_ctrl_func[], which is indexed within the loop, has only 32 entries.
svn path=/trunk/; revision=50281
2013-07-01 03:44:41 +00:00
Chris Maynard 53d3514593 Fix Coverity CID's 1037112, 1037113 and 1040635 (Explicit null dereferenced).
svn path=/trunk/; revision=50280
2013-07-01 03:33:50 +00:00
Chris Maynard 50d79e872a A better fix than r50278.
svn path=/trunk/; revision=50279
2013-07-01 03:31:11 +00:00
Chris Maynard c12624f43b Realized that Coverity would have still complained about "explicit null dereferences", so add in some additional checks.
svn path=/trunk/; revision=50278
2013-07-01 03:01:59 +00:00
Guy Harris f426c3cd45 Consistently maintain the callState member of an iax2_info_t structure
as a voip_call_state value; don't have it sometimes a voip_call_state
and sometimes a frame subtype.

This should squelch some complaints from newer versions of Clang about
unnecessary array-bounds checks - the array-bounds checks are done on
frame subtypes, where they *are* necessary (nothing prevents an
untrustworthy IAX2 implementation or an untrustworthy capture file
writer from putting an arbitrary value in the packets), not on
voip_call_state values (where it was only necessary because the value
wasn't, in that case, a voip_call_state value, it was a frame subtype
cast to a voip_call_state).

svn path=/trunk/; revision=50277
2013-07-01 02:51:48 +00:00
Chris Maynard 3e0168d1c5 Use tvb_reported_length_remaining() instead of tvb_length_remaining().
svn path=/trunk/; revision=50276
2013-07-01 02:42:40 +00:00
Chris Maynard b2ed927a80 Fix Coverity CID 280550 (Dereference null return value) by checking that ieee_hints is not NULL before dereferencing it (as is done in all other cases).
svn path=/trunk/; revision=50275
2013-07-01 02:05:11 +00:00
Chris Maynard f435ace8aa Fix Coverity CID 1040370 (Explicit null dereferenced) by removing the if (tree) { ... } tests so that payload_tree is always assigned regardless of whether tree is NULL or not.
Fix Coverity CID 1040371 (Negative loop bound) by not assignin the return value of tvb_length_remaining() to an unsigned integer and then using that value for loop termination.  Instead, assign the return value to a signed integer and only if tvb_length_remaining() returns a value greater than zero do we even begin to loop.

In addition, use tvb_length_remaining() instead of tvb_length() to determine if more data exists, and then if it does, when displaying the payload bytes following the cmd_id, only pass the number of remaining bytes following the cmd_id rather than the entire length, which would include the 1 byte for the cmd_id itself.

Other minor changes.

svn path=/trunk/; revision=50274
2013-07-01 01:56:23 +00:00
Luis Ontanon baee2e21f7 ANother iteration,
- started harvesting pieces from tshark.
- fixed? signal handlers
- interactive test program

very hard to debug... set follow-on-fork doesn't seem to work on my mac. Need linux I guess...


svn path=/trunk/; revision=50273
2013-07-01 01:49:34 +00:00
Jeff Morriss e03edbf713 From David Richards via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8871 :
TLS decryption fails when trying to decrypt XMPP sessions using start_tls as
the port in the key list of the SSL preferences.

Looking at the code, the XMPP dissector has 2 issues:

1) The crude XML element detection for XMPP segmentation is run before
checking if the SSL dissector should be called.  As a result, the SSL dissector
is not called at the appropriate times.

2) The SSL dissector is called withoug resetting the desegment flags are not
manipulated as the SMTP dissector does so segmented SSL packets are not properly
reconstructed.  Generally this causes the server hello not to be detected.

A proposed patch to fix these issues is attached.

svn path=/trunk/; revision=50272
2013-06-30 23:25:37 +00:00
Bill Meier 6499394c78 Declare slist[] as static (reduces storage & code executed: *See below);
Declare dlist[] similarly to slist[] (not really needed since generated storage/code was OK as is)

*On Windows the following program generates sub-optimal code
 (when built using VC10 or VC11 with CFLAGS as used when building Wireshark).

void foo(void) {
    const char *const zz[] = {"ABC", "abc"};
}
-------------

Code generated:

<snip>
_DATA	SEGMENT
$SG1013	DB	'ABC', 00H  !!! note string stored twice !!
$SG1014	DB	'ABC', 00H
$SG1015	DB	'abc', 00H
$SG1016	DB	'abc', 00H
_DATA	ENDS

<snip>
; 1    : void foo(void) {

	push	ebp
	mov	ebp, esp
	sub	esp, 8

; 2    :     const char *const zz[] = {"ABC", "abc"};

	mov	DWORD PTR _zz$[ebp], OFFSET $SG1014    !! note: each ptr of array
	mov	DWORD PTR _zz$[ebp+4], OFFSET $SG1016  !!  individually pushed on stack

<snip>

Not shown: Declaring zz as 'static' generates much better code....


svn path=/trunk/; revision=50271
2013-06-30 23:03:20 +00:00
Michael Mann 5bbc26236a Batch of filterable expert infos.
Also added a note about deprecating expert_add_info_format

svn path=/trunk/; revision=50270
2013-06-30 22:19:37 +00:00
Jeff Morriss 20674d8877 From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8876 :
Errors in preferences preceding "gui.console_open" are not immediately
displayed in the console:  If a gui.console_open is set to "AUTOMATIC" or
"ALWAYS" and an error or warning occurs in a preference previous to it, the
warning is not displayed in the console window because the window is not yet
open. However, if the user switches to another profile and returns, the
messages will be displayed.

Fix: Move the gui.console_open to the top of the list in
prefs_register_modules() of prefs.c. Existing preferences files can be
corrected by saving them.

svn path=/trunk/; revision=50269
2013-06-30 21:58:25 +00:00
Jeff Morriss 2808e853ed Actually initialize the localhost ethernet address before setting
dl_src/dl_dst to it.

Fixes uninitialized-read warnings from Valgrind on the capture in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8827

svn path=/trunk/; revision=50268
2013-06-30 21:34:40 +00:00
Jeff Morriss e9c8d4119b Add a cast to squelch a warning.
svn path=/trunk/; revision=50267
2013-06-30 20:56:28 +00:00
Jeff Morriss bdd5588ed6 Fix up a mixup of the declaration of hf_vnc_auth_error_length and
hf_vnc_auth_error.

svn path=/trunk/; revision=50264
2013-06-30 20:06:05 +00:00
Jeff Morriss 7a767ed9c4 From Matthias Benesch via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8869 :
This patch adds dissection of the following VNC extensions:
 - MirrorLink messages (http://mirrorlink.com/)
 - Context Information pseudo encoding (http://mirrorlink.com/)
 - Scan Line based Run-Length encoding (http://mirrorlink.com/)
 - LibVNCServer additions (http://libvncserver.sourceforge.net/)
 - H.264 encoding

From me: fix encoding arguments.

svn path=/trunk/; revision=50263
2013-06-30 20:04:10 +00:00
Michael Mann 8723265c1d Minor improvements to VTP dissector.
1. More items "filterable" through proto_tree_add_item and expert_add_info_format_text
2. Update protocol spec reference
3. Remove some length checks to allow for malformed packets within dissect_vlan_info since the entire "vlan info structure" is necessary. 

svn path=/trunk/; revision=50262
2013-06-30 18:03:43 +00:00
Jeff Morriss 7fa41b815c Add a question about whether hf_pn_rt_frag_data should be FT_STRING or FT_BYTES.
svn path=/trunk/; revision=50261
2013-06-30 16:59:58 +00:00
Jeff Morriss c3aab70dd8 Fix the infinite loop fuzz failure reported in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8875 :

Don't let a negative item_length decrement our offset.

svn path=/trunk/; revision=50258
2013-06-30 16:28:52 +00:00
Jeff Morriss 772b17a6c6 Actually use the new environment variable created in r49784--apparently I forgot to check in this file (sigh).
svn path=/trunk/; revision=50257
2013-06-30 16:16:13 +00:00
Gerald Combs 08ba0370f9 [Automatic manuf, services and enterprise-numbers update for 2013-06-30]
svn path=/trunk/; revision=50254
2013-06-30 14:03:40 +00:00
Jakub Zawadzki 33abb4e091 proto_custom_set: don't fetch values twice.
svn path=/trunk/; revision=50252
2013-06-30 13:23:31 +00:00
Jeff Morriss df5c2548dd ip_proto.h now requires expert.h.
svn path=/trunk/; revision=50249
2013-06-30 11:06:32 +00:00
Michael Mann 4d18fdf67d Add expert info to dissect_ip_tcp_options(). The proto_tree_add_text seems a bit duplicative, but the byte highlighting over the whole option is nice.
svn path=/trunk/; revision=50248
2013-06-30 03:16:32 +00:00
Alexis La Goutte b6adc8798d Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50247
2013-06-29 22:01:21 +00:00
Alexis La Goutte 1a364db097 Fix warning from fix-encoding-args
epan/dissectors/packet-scsi.c:  FT_BYTES:         proto_tree_add_item(tree, hf_scsi_report_opcodes_cdb_usage_data,                            tvb_v, offset_v+4, length, [[ENC_BIG_ENDIAN]-->[ENC_NA]]);

svn path=/trunk/; revision=50246
2013-06-29 22:01:13 +00:00
Alexis La Goutte 397ab1dbb7 Fix indent (Tabs => Spaces) and add modelines info for follow_* files
svn path=/trunk/; revision=50245
2013-06-29 22:01:01 +00:00
Alexis La Goutte 1dfecc041c Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50244
2013-06-29 22:00:50 +00:00
Alexis La Goutte 70dde30fe9 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50243
2013-06-29 22:00:42 +00:00
Alexis La Goutte 5da25f80b4 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50242
2013-06-29 22:00:31 +00:00
Alexis La Goutte 6680177541 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50241
2013-06-29 22:00:22 +00:00
Alexis La Goutte c18eb788c2 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50240
2013-06-29 22:00:13 +00:00
Alexis La Goutte e5d0603e0b Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50239
2013-06-29 22:00:03 +00:00
Alexis La Goutte 43be7b67aa Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50238
2013-06-29 21:59:53 +00:00
Alexis La Goutte 391f902f44 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50237
2013-06-29 21:59:44 +00:00
Alexis La Goutte 484bf76753 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50236
2013-06-29 21:59:35 +00:00