Commit Graph

53792 Commits

Author SHA1 Message Date
Guy Harris 79fcc6a1a3 Squelch some compiler warnings.
Change-Id: Ie39c7b0c1fef8f862cec016a3a1a5bd1451a3df2
Reviewed-on: https://code.wireshark.org/review/2905
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 23:49:04 +00:00
Peter Wu f2b4daf400 Add printf-format annotations, fix garbage
The WRETH dissector showed up some garbage in the column display. Upon
further inspection, it turns out that the format string had a trailing
percent sign which caused (unsigned)-1 to be returned by
g_printf_string_upper_bound (in emem_strdup_vprintf). Then ep_alloc is
called with (unsigned)-1 + 1 = 0 memory, no wonder that garbage shows
up. ASAN could not even catch this error because EP is in charge of
this.

So, start adding G_GNUC_PRINTF annotations in each header that uses
the "fmt" or "format" paramters (grepped + awk). This revealed some
other errors. The NCP2222 dissector was missing a format string (not
a security vuln though).

Many dissectors used val_to_str with a constant (but empty) string,
these have been replaced by val_to_str_const. ASN.1 dissectors
were regenerated for this.

Minor: the mate plugin used "%X" instead of "%p" for a pointer type.

The ncp2222 dissector and wimax plugin gained modelines.

Change-Id: I7f3f6a3136116f9b251719830a39a7b21646f622
Reviewed-on: https://code.wireshark.org/review/2881
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 23:00:40 +00:00
Peter Wu ec6a22dc3b Workaround for ASAN failure in _ws_mempbrk_sse42
When ASAN is enabled, a false buffer overflow warning is raised. It is
a false positive since everything starting at '\0' will get ignored by
the PCMPISTRI instruction (see Intel(r) SSE4 Programming Reference,
5.3.1.5 "Valid/Invalid Override of Comparisons", and 5.3.1.2
"Aggregrate Operation", case "Equal any").

Concerns about reading past the end of the page turns out to be false,
there always seem to be a valid page after the current one (for static
and heap memory at least). It is an non-issue since strlen also does
not have issues with this.

Rather than fully disabling SSE 4.2 and using the fallback
implementation for ASAN-enabled builds, read the set of characters from
'a' into the mask without a 128-bit read and then still use SSE 4.2
for the actual query.

Bug: 10214
Change-Id: Ie4a526e60b43bfc08dd1d821556766f14a49be4d
Reviewed-on: https://code.wireshark.org/review/2618
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 22:53:34 +00:00
Peter Wu 49bc1047be whois,finger: fix retval, convert from tvb_length
Fixes dissector bug:
failed assertion "save_desegment_offset == pinfo->desegment_offset &&
save_desegment_len == pinfo->desegment_len"

Change-Id: Ia475bea3726252530189a05ba4dbf69f3c2b7e6c
Reviewed-on: https://code.wireshark.org/review/2886
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 22:05:26 +00:00
Guy Harris 5bfc21cf9e Clean up handling of missing functions.
With autotools, CMake, and nmake, if we have a function, #define
HAVE_{function_name_in_all_caps}, otherwise don't #define it.

If we provide our own version of a function in libwsutil, make sure we
have a header that declares it, and *ONLY* include that header if
HAVE_{function_name_in_all_caps} is *NOT* defined, so that we don't have
the system declaration and our declaration colliding.

Check for inet_aton, strncasecmp, and strptime with CMake, just as we do
with autotools.

Simplify the addition of {function_name_in_all_caps}_LO to libwsutil in
autotools.

Change-Id: Id5be5c73f79f81919a3a865324e400eca7b88889
Reviewed-on: https://code.wireshark.org/review/2903
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 21:03:09 +00:00
Pascal Quantin e649420686 H264: mark a parameter as unused
Change-Id: I564a0fefc263d909c9e478b64c5a816756d97377
Reviewed-on: https://code.wireshark.org/review/2902
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-07-06 19:44:01 +00:00
Pascal Quantin 032c261997 GTK: fix crash when closing Capture Options dialog box on Windows
Introduced in g929afd2

Change-Id: I911994af2a210f00cd099f26e68d1e1f0fea577b
Reviewed-on: https://code.wireshark.org/review/2901
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-07-06 19:14:52 +00:00
Britt McKinley 4e9802e679 H264: Add support of packetization modes, SVC, MS-H264
Add support for Prefix, STAP, MTAP, NI-MTAP, and PACSI packet types.
Add support for Microsoft SEI messages [MS-H264PF]
Add support for dissecting scalable profiles
SDP: Add profile-level-id decode for payload type H264-SVC
MS-H264PF: http://msdn.microsoft.com/en-us/library/hh659565.aspx
Update #1 - Fix Tabs -> Spaces, Reinsert accidentally removed entry 19
from h264_type_values
Update #2 - Changed to using expert info for exceptions and Microsoft
errata.
Update #3:
  - Correct handling of truncated packets
  - Use guid functions and compare techniques
  - Correct ranges for expert info messages
  - Change to using reported_length from captured_length

Change-Id: I520a3c9a6d85c78a976b520cf5a6a405064a48f1
Reviewed-on: https://code.wireshark.org/review/2580
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-07-06 19:11:24 +00:00
Alexis La Goutte c35b82c8f1 RTCP: Make checkhf happy
Change-Id: I5cdeb4a96bc9c4e11161836457a8689c904e13d4
Reviewed-on: https://code.wireshark.org/review/2899
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-06 18:32:17 +00:00
Alexis La Goutte 68daa668e4 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I9946e55ee33ccbf57c6b268f725f5b1a537b61a9
Reviewed-on: https://code.wireshark.org/review/2897
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-06 18:31:20 +00:00
Alexis La Goutte 550f611162 RTCP: fix typo (double semicolon)
Change-Id: Id1997c3c8f6d0460da7f0faa58798a72737dd667
Reviewed-on: https://code.wireshark.org/review/2898
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-06 18:30:26 +00:00
Alexis La Goutte 841b1d652c Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I5744a1c1efc65f9a7b3addf17c071b470fd2cced
Reviewed-on: https://code.wireshark.org/review/2896
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-06 18:30:06 +00:00
Alexis La Goutte 84189ded75 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I82efd1c5f4280de2eec3dbe7bd1995fcd9a3174f
Reviewed-on: https://code.wireshark.org/review/2895
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-06 18:28:23 +00:00
Michael Mann c71e88e4a9 convert to proto_tree_add_subtree[_format]
Change-Id: I3efa2a81ab2685cde6eae0a00b24520478a545ce
Reviewed-on: https://code.wireshark.org/review/2900
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-06 18:26:48 +00:00
Evan Huus be4d42c6ab Widen openflow variables and check for underflows
As suggested by Alexis reviewing change Ie76c5a810af927b, this issue was
scattered throughout the v4/v5 openflow dissectors. Hopefully I got all of them.
Original issue found in bug 10259.

Change-Id: Idf87deea34132aec5cd4e8f83264906a29b15568
Reviewed-on: https://code.wireshark.org/review/2878
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-07-06 16:53:39 +00:00
Peter Wu 5886e45179 iscsi: minor retval fix
The return value of new dissectors is the number of bytes that were
successfully dissected, not a boolean. Fix that and get rid of an
unnecessary iSCSIPdusDissected variable.

Change-Id: Ie31df393a1eb44f185d320a4c2d35f5e8b7d7bd9
Reviewed-on: https://code.wireshark.org/review/2889
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 15:51:45 +00:00
Peter Wu d828b15a82 kismet: fix retval, add modelines
new dissectors return an int, not a boolean...

Change-Id: I88e19f7c0dc14da3649d1522ffe936538a867753
Reviewed-on: https://code.wireshark.org/review/2888
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 15:47:51 +00:00
Peter Wu 2eae8bb0c3 mikey: do not request more data on proto violation
Return value "-1" means that more data is requested. The dissector
actually doesn't have any idea what to do with the data, so just return
the data dissected so far.

tcp stream 3182 from c05-http-reply-r1.pcap (SampleCaptures) was
incorrectly detected as MIKEY, it was actually HTTP...

Change-Id: Idca3d3e2f85e821df70436a675699b5834236f89
Reviewed-on: https://code.wireshark.org/review/2887
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 15:45:33 +00:00
Peter Wu b54731dc7d ms-mms: fix retval for short pkts, fix reading flags
uint16 & 0xFF00 will always equal 0. Use tvb_get_guint8 instead. Convert
from tvb_length to tvb_captured_length.

Fix the return value of dissectors, 0 means reject but that cannot be
combined with reassembly requests.

Change-Id: I5fca66e2e809699392237aff5813eecdfb15857f
Reviewed-on: https://code.wireshark.org/review/2885
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 15:42:58 +00:00
Gerald Combs 03d6f1b0db [Automatic manuf, services and enterprise-numbers update for 2014-07-06]
Change-Id: Idc1a85851a01b5b675465b659871cdf750845ace
Reviewed-on: https://code.wireshark.org/review/2890
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-07-06 15:16:14 +00:00
Evan Huus 4afd70d4e4 Use g_hash_table_new_full to free some values
Fixes a good 80-90KB of leaks in certain cases.

Bug: 10261
Change-Id: I81d57ac67219e730b03649b9fdfc2306807bdb97
Reviewed-on: https://code.wireshark.org/review/2879
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-06 14:27:27 +00:00
Michael Mann 6318a29fa3 convert to proto_tree_add_subtree[_format]
Change-Id: Ia2567695ffed30c990eda3740b08bfab101cea96
Reviewed-on: https://code.wireshark.org/review/2883
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-06 14:21:15 +00:00
Guy Harris db530d886d Squelch casting-away-constness warnings.
The pStr argument to dissect_mq_charv() isn't modified (and always
points to a character string), so make it a "const char *", and
eliminate the casts to "guint8 *" in calls to it.

Change-Id: I21dad38c41324528be297a8ddc1854beff2276db
Reviewed-on: https://code.wireshark.org/review/2877
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 11:25:41 +00:00
Guy Harris 2a740bd4d5 Squash casting-away-constness warnings.
BYTE2WORD() doesn't modify what its argument points to, so make that
argument a const unsigned char *.

This lets us get rid of casts that cast away constness.

Change-Id: I44a58bd3d75fc77a022b7e8f7fa9b43990bcf81c
Reviewed-on: https://code.wireshark.org/review/2876
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 11:15:18 +00:00
Роман Донченко afa8f21f56 make-dissectors-reg: optimize by factoring out the loops
Instead of calling the grep/sed pipelines for each file, build the
list of files in the beginning and call each pipeline only once,
passing the list to the first grep.

This results in a massive speedup in Cygwin; in my test, the time
it takes to run make-dissector-reg . dissectors packet-*.c in dissectors/epan
is reduced from ~116 to ~3 seconds. I also tried it on NetBSD, where
the time do to the same goes from ~6 to ~0.5 seconds.

Amend makefile comments to elide mentions of invoking multiple processes
per file.

Change-Id: Iad441e7d2b6cc3669dada57646e2f8f6b987fd34
Reviewed-on: https://code.wireshark.org/review/2826
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-06 08:08:20 +00:00
Michael Mann 3490bc6eb9 Change display filters to prefix with ipmi.trace
Change-Id: I7b4476cb0a06362941ef81707a9686f5546a4a54
Reviewed-on: https://code.wireshark.org/review/2868
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-06 08:03:29 +00:00
Guy Harris 8481c43861 Fix more errors revealed by enum-to-integer conversion warnings.
Change-Id: Ib28af874cbac0623ed94e7558f3711e9a1b03a2d
Reviewed-on: https://code.wireshark.org/review/2874
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 02:26:11 +00:00
Guy Harris ab5d1cfa20 Squelch a warning.
Change-Id: Id27a6447dba9b6eda07933139a3f07edd71c8fd6
Reviewed-on: https://code.wireshark.org/review/2872
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 01:33:31 +00:00
Guy Harris c654add76c Add consts to casts to suppress warnings.
Pull the "cast this to a pointer to an __m128i" idiom into a macro, and
use the macro; have that macro use "const" in the casts.

Change-Id: Ife90b7daef2f09368790f3b2ffbb227d6d794dea
Reviewed-on: https://code.wireshark.org/review/2871
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 01:30:18 +00:00
Guy Harris 570d52a844 Pull the record processing into netmon_process_record().
That combines more common code from the read and seek-read code
paths.

Also, separate out the individual metadata record types, with a comment
for each, to simplify the process of supporting some or all of them in
the future.

Change-Id: Ic8ded397d9550ec6013c1f5f138333b1ef5c37e5
Reviewed-on: https://code.wireshark.org/review/2869
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 01:13:44 +00:00
Michael Mann 0335ae339d convert to proto_tree_add_subtree[_format]
Change-Id: I66f0bffb987568c3d4c14a06bdc90465c877b27f
Reviewed-on: https://code.wireshark.org/review/2867
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-05 23:08:19 +00:00
Guy Harris 318205e699 Fix an error caught by enum-conversion warnings.
(Strong typing is for weak minds.

Human minds are weak.

Therefore, strong typing is for human minds.)

Change-Id: I099b85e98f3b9742b1addd8d260b3e94ca7add31
Reviewed-on: https://code.wireshark.org/review/2866
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-05 22:22:44 +00:00
Evan Huus 42b537ea49 Reset state when cycling ring-buffer files in tshark.
This has several implications:
 - we match user expectations that a ring-buffered tshark capture will run
   forever without running out of resources (except where we still have leaks)
 - we lose reassembly and request/response matching when the relevant packets
   are split across files, but this actually makes our output more consistent
   with dissecting those files after-the-fact

I have not made it configurable in this change because I'm not really sure
there's a use case for the old behaviour - if you're running a ring-buffer
capture in the first place it's because you're willing to discard old data to
limit resource usage. If you want the full dissection without breaks, just don't
use a ring buffer at all and take the resource hit in both disk and memory.

Change-Id: I7d8f84b2e6040b430b7112a45538041f2c30f489
Reviewed-on: https://code.wireshark.org/review/2669
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-05 22:08:59 +00:00
Peter Wu 286c191846 9p: fix version detection, fix dissect_9P retval
Fix version detection (detect against full string instead of prefix),
properly dissect Tcreate extension field (9p2000.u only), dissect
Tunlinkat flags (9p2000.L).

Refactor pattern to dissect string[s] types for DRY.

Convert to use tcp_dissect_pdus. I have not seen a fragmented case, but
maybe that may happen in the future.

The main motivation for touching 9p was that it returns bogus values
for some types. This has been fixed by properly increasing offset, and
always return the captured length.

Change-Id: If2184204ae9c853b94aca8ade3763d7fe523fa86
Reviewed-on: https://code.wireshark.org/review/2836
Reviewed-by: Christopher Maynard <Christopher.Maynard@gtech.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-05 22:04:54 +00:00
Michael Mann fc63343a4e convert to proto_tree_add_subtree[_format]
Change-Id: I8df48b25de784a48a25f0e48aac1e1545ed92c35
Reviewed-on: https://code.wireshark.org/review/2865
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-05 20:36:36 +00:00
Guy Harris 3f7725174d Fix an error caught by enum-conversion warnings.
(Strong typing is for weak minds.

Human minds are weak.

Therefore, strong typing is for human minds.)

Change-Id: I2a973b6168235d5d1c7f2a5f8ac79b97b963d846
Reviewed-on: https://code.wireshark.org/review/2863
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-05 19:32:56 +00:00
Guy Harris c8bcdd5271 Fix whitespace issues.
Change-Id: I69f84ca8b947be8e06005c82526559e3bc8f6387
Reviewed-on: https://code.wireshark.org/review/2861
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-05 18:49:23 +00:00
Guy Harris 599b880e4c Handle the UTC timestamps in NetMon 2.3 files.
This addresses part of, but not all of, the issues in bug ten thousand,
one hundred, and ninety:

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

(I'm spelling it out to make sure Gerrit doesn't think this change
*does* address all the issues in that bug, and mark it as RESOLVED
FIXED; I feel like I have to treat Gerrit as a dog or small child from
whom I'm trying to keep a secret - "honey, I'm taking the dog to the
vee eee tee".)

Change-Id: Ic234130c1ea84cfaf47901485dca775e168f71d0
Reviewed-on: https://code.wireshark.org/review/2859
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-05 18:46:57 +00:00
Alexis La Goutte 3686713e7c Update libnghttp2 to latest master (add support for draft-13)
Bug:10256
Change-Id: I24275f1b67120f69cfd673f7e5598a50b3c7566f
Reviewed-on: https://code.wireshark.org/review/2145
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-07-05 07:11:21 +00:00
Evan Huus c92bf7e44b Expand a variable from 16 to 32 bits (and make it signed).
Fixes an overflow leading to infinite loop.

Bug: 10259
Change-Id: Ie76c5a810af927ba092f4067268bd789b3a7d7bf
Reviewed-on: https://code.wireshark.org/review/2856
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-04 21:53:08 +00:00
Pascal Quantin e398c8ed6b ETSI CAT: upgrade dissector to Release 12
Change-Id: Id1988551ca94a862195eb1de1de399e428132b21
Reviewed-on: https://code.wireshark.org/review/2855
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-07-04 19:38:41 +00:00
Guy Harris 09511c2f62 Build libcaputils PIE, so it can be linked with dumpcap when it's built PIE.
Change-Id: Ic1a64252e913f668676a3d8b69c10cc4789156b3
Reviewed-on: https://code.wireshark.org/review/2854
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-04 17:23:01 +00:00
Michael Mann c7a6e6fa13 convert to proto_tree_add_subtree[_format]
Change-Id: I621f2e2cad9403449cb78f45302388f0c874d3bc
Reviewed-on: https://code.wireshark.org/review/2852
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-04 16:59:14 +00:00
Michael Mann 93517043e9 convert to proto_tree_add_subtree[_format]
Change-Id: Idd1b20ab32c0960ea52c6f3bc5346462c37c5684
Reviewed-on: https://code.wireshark.org/review/2853
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-04 16:46:14 +00:00
AndersBroman dd424c6225 Handle the case where the previous PDU has left an extra CRLF in the stream.RFC 2626 In the interest of robustness, servers SHOULD ignore any empty line(s) received where a Request-Line is expected. In other words, if the server is reading the protocol stream at the beginning of a message and receives a CRLF first, it should ignore the CRLF.
Change-Id: I97ba94f451463c8facd2c20bf6b7364f095119e7
Reviewed-on: https://code.wireshark.org/review/2808
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-04 14:00:50 +00:00
AndersBroman 34d09f770c Add missing /
Change-Id: I84758200bce592f84547bff84f02d743327baa03
Reviewed-on: https://code.wireshark.org/review/2848
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-04 12:07:38 +00:00
Guy Harris fc52dc6f1b rawshark needs libcaputils.
Change-Id: I38409f5ceef1c906dccb13284d2fe2dfd2383b67
Reviewed-on: https://code.wireshark.org/review/2845
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-04 08:09:51 +00:00
Guy Harris d3a7176ab7 Reflect the rename of get_XXX_pcap_version() to get_XXX_caplibs_version().
Change-Id: I55108e39d9d5a3fc5e1e3e0ec0040c08c92cc576
Reviewed-on: https://code.wireshark.org/review/2844
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-04 08:06:38 +00:00
Guy Harris 17995db2ff Fix the no-libpcap build.
Change-Id: I2443ab22d423508641ac199262238e5fbafc95df
Reviewed-on: https://code.wireshark.org/review/2843
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-04 08:01:41 +00:00
Evan Huus 7e970c32f4 wmemify some nfs functions, fixing much leaked memory
Bug: 10257
Change-Id: Ia36c03b2be727a37f91eca38af4faf48d1d65436
Reviewed-on: https://code.wireshark.org/review/2840
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-04 07:59:04 +00:00