Commit Graph

47261 Commits

Author SHA1 Message Date
Michael Mann a6acb73611 Make expert items filterable. First use of proto_tree_add_expert.
svn path=/trunk/; revision=50327
2013-07-02 21:16:10 +00:00
Jakub Zawadzki 68c2c57037 Remove tree argument from TRY_TO_FAKE_THIS_REPR macro
PTREE_DATA should be the same for both *tree* and *pi*

svn path=/trunk/; revision=50326
2013-07-02 20:51:58 +00:00
Michael Mann e5cb4d84cc proto_malformed SHOULD NOT be used outside of show_exception.c
svn path=/trunk/; revision=50325
2013-07-02 20:43:21 +00:00
Michael Mann a19eaef617 Remove "global" proto_malformed and update some of the expert_info items that really aren't "malformed".
svn path=/trunk/; revision=50324
2013-07-02 20:25:14 +00:00
Michael Mann 7ae263b9e4 Differentiate "Disabled" from "Unknown" and provide macros for the enumerated values.
svn path=/trunk/; revision=50323
2013-07-02 20:08:49 +00:00
Michael Mann e16933f496 Add proto_tree_add_expert and proto_tree_add_expert_format. This was added to expert.h instead of proto.h because the underlying code to process expert info is static (and should probably remain so). Also, proto_tree_add_expert and proto_tree_add_expert_format follow "expert info" rules in that they should be called regardless of tree status (even though they take a tree as an argument), unlike the functions in proto.h
Also added an enumeration for checksum validation status, as verifying checksums is considered "expert" functionality.

svn path=/trunk/; revision=50322
2013-07-02 19:53:28 +00:00
Jakub Zawadzki b0e04aca73 Rewrite proto_lookup_or_create_interesting_hfids() and rename to proto_data_add_maybe_interesting_field
Now proto_data_add_maybe_interesting_field:
- it actually add field_info to interesting hash_tree
- accept only required parameters
- is called only by proto_tree_add_node

svn path=/trunk/; revision=50321
2013-07-02 19:23:10 +00:00
Jakub Zawadzki 1d2409dd69 Micro-optimize common case for proto_tree_add_pi() assume tree != NULL, pfi != NULL
Fix calles.

svn path=/trunk/; revision=50320
2013-07-02 18:56:48 +00:00
Jakub Zawadzki cce4ad3c66 tree == NULL check is already done by TRY_TO_FAKE_THIS_ITEM() macro.
svn path=/trunk/; revision=50319
2013-07-02 18:45:47 +00:00
Jakub Zawadzki 874f119225 Remove not needed TRY_TO_FAKE_THIS_ITEM() from proto_tree_*_format & proto_tree_*_format_value
Right now for proto_tree_add format & _format_value TRY_TO_FAKE_THIS_ITEM() is called twice
one from 'format' function, second time from 'no format' function.

This reduces size of .text by 10K:
   text    data     bss     dec     hex filename
  76012     112      56   76180   12994 proto-after.o
  86324     112      56   86492   151dc proto-before.o


svn path=/trunk/; revision=50318
2013-07-02 18:36:00 +00:00
Gerald Combs b2788e5687 Preserve symlinks when copying libraries into the application bundle on
OS X so that it doesn't become excessively large.

svn path=/trunk/; revision=50317
2013-07-02 18:26:52 +00:00
Jakub Zawadzki d27f026884 cleanup, put result of decode_bitfield_value directly to fi->rep->representation
svn path=/trunk/; revision=50316
2013-07-02 17:09:38 +00:00
Michael Mann 090ddb6afc Remove dependency on proto_malformed as it should be encapsulated in expert info API (through show exception API)
svn path=/trunk/; revision=50315
2013-07-02 16:51:03 +00:00
Jakub Zawadzki 2ab52de572 Add TRY_TO_FAKE_THIS_REPR into proto_tree_set_representation_value() call.
Remove TRY_TO_FAKE_THIS_REPR from calling functions.

svn path=/trunk/; revision=50314
2013-07-02 16:09:56 +00:00
Michael Mann ecc4e4789e Cache the malformed filter instead of looking it up each time a malformed packet comes in. This drastically speeds up the load time of captures with lots of malformed packets (ie fuzztesting).
svn path=/trunk/; revision=50313
2013-07-02 16:02:31 +00:00
Jeff Morriss 0643b22517 From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8878 :
The final maintenance patch, after excessive testing of the dissection engine.
The last two bugs were:

- FindSafetyFrame did not recognize the correct CRC, which in itself did not
  lead to wrongly detected packages, but was inconsistent with the rest.

- CRC == 0 - because 0 is a valid result for the CRC value.

svn path=/trunk/; revision=50312
2013-07-02 14:15:40 +00:00
Jakub Zawadzki d0c5a5561d snprintf -> strlcpy.
svn path=/trunk/; revision=50311
2013-07-02 14:14:52 +00:00
Michael Mann 14d105ee4c Make expert items filterable and a little cleanup.
Remove NULL tree check at start of dissection to ensure expert info is populated.

Overall I think the logic could be a little cleaner (length checking and its tie to expert info seems excessive), but I'm not familiar enough to be comfortable making the changes.

This dissector appears to be vulnerable to DOS attacks through its unsigned 16-bit length fields (just from static inspection).  Having the length be a signed 32-bit value even if the length in the protocol field is an unsigned 16-bit value could simplify some of the logic.

svn path=/trunk/; revision=50310
2013-07-01 23:59:05 +00:00
Evan Huus a0d874ae0a From Fabio Tarabelloni via
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8718

Misc. minor improvements to zigbee zcl.

svn path=/trunk/; revision=50309
2013-07-01 23:21:44 +00:00
Evan Huus be688c88f2 From Javier Godoy via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8832
Support for OSD-2/3 in the SCSI dissector.

svn path=/trunk/; revision=50308
2013-07-01 23:17:06 +00:00
Bill Meier 02a6c2b462 Do whitespace cleanup;
Reformat hf[] entries.

svn path=/trunk/; revision=50307
2013-07-01 20:54:15 +00:00
Chris Maynard c015eb1972 Add some casts to try to appease the Ubuntu buildbot, which is angry from r50303.
svn path=/trunk/; revision=50306
2013-07-01 20:38:12 +00:00
Chris Maynard b26abebc27 Fix Coverity CID 280618 (Dereference before null check).
#BACKPORT(1.10,1.8)

svn path=/trunk/; revision=50305
2013-07-01 20:25:49 +00:00
Evan Huus 8dfe279520 Remove unused parameters.
svn path=/trunk/; revision=50304
2013-07-01 19:55:39 +00:00
Chris Maynard b14de31a4c Fix Coverity CID 997052 (Infinite loop) by declaring 'err' volatile.
#BACKPORT(1.10)

svn path=/trunk/; revision=50303
2013-07-01 19:52:32 +00:00
Michael Mann 71e6d4be77 Made an attempt at making all TCP expert info filterable. Many of the expert info "items" are shared with a FT_NONE (hf_ display) filter, so I replaced the FT_NONE filter used with proto_tree_add_none_format() and just went with an expert info "item" with the same display filter name. The text between the "text" item and the "expert info" item varied, so I'd tried to best merge the two.
"tcp.analysis.duplicate_ack" has both an hf_ and ei_ "item" so that the duplicate ack # and frame # can be assembled properly in the tree.  Since hf_tcp_analysis_duplicate_ack is of type FT_NONE, the duplicative display filter name is okay.

svn path=/trunk/; revision=50302
2013-07-01 16:32:52 +00:00
Chris Maynard 3f0aefb91e Fix Coverity CID 1035326 (Improper use of negative value) by guarding against tvb_reported_length_remaining() possibly returning -1.
#BACKPORT(1.10,1.8)

svn path=/trunk/; revision=50301
2013-07-01 16:29:17 +00:00
Bill Meier 828d4e89f6 Define certain 'const char *...' arrays as static.
(That is: Don't create the array on the stack each time
  the function is called).

 Reduces code memory usage and execution time.
 (See SVN #50271)


svn path=/trunk/; revision=50300
2013-07-01 15:41:05 +00:00
Jakub Zawadzki 7b5a0e4a15 Cleanup fill_label_[u]int64 to fill_label_number64
svn path=/trunk/; revision=50299
2013-07-01 15:24:42 +00:00
Chris Maynard ff8842c865 Fix Coverity CID 1037114 (Dereference before null check).
svn path=/trunk/; revision=50298
2013-07-01 15:20:02 +00:00
Chris Maynard 17772df943 Fix Coverity CID 1040373 (Dereference before null check). Minor whitespace changes come along for the ride on this one.
svn path=/trunk/; revision=50297
2013-07-01 15:09:56 +00:00
Bill Meier 3f4fb4d56b Define certain 'const char *...' arrays as static.
(That is: Don't create the array on the stack each time
  the function is called).

 Reduces code memory usage and execution time.
 (See SVN #50271)


svn path=/trunk/; revision=50296
2013-07-01 14:40:58 +00:00
Bill Meier 43442af8e3 Define certain 'const char *...' arrays as static.
(That is: Don't create the array on the stack each time
  the function is called).

 Reduces code memory usage and execution time.
 (See SVN #50271)


svn path=/trunk/; revision=50295
2013-07-01 14:32:08 +00:00
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