Commit Graph

53811 Commits

Author SHA1 Message Date
Peter Wu 8fbc0db7d2 conversion: do not free conversation memory on updates
In commit 4afd70d ("Use g_hash_table_new_full to free some values"), the
hashtable gained a destroy handler which frees memory. This
inadvertently destroyed a conversation during key updates.

Fix this by not calling _remove (and thereby calling the destroy
handler), but use _steal instead. (Suggestion by Evan Huus).

Bug: 10263
Change-Id: I9fa7f5a697599f42894d38718b00b9c0c1b57004
Reviewed-on: https://code.wireshark.org/review/2924
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-08 03:46:04 +00:00
Peter Wu 9b4f16a204 gsmtap: do not abort if dissector is unavailable
Encountered with the following attachments from bugs:
6575-test-dlmapc-wmx
6577-test-dlmapc-wmx
6579-test-dlmapc-wmx

Also added modelines.

Change-Id: I3859bed618830ad359bd0b2b1fdfc3c5fc13269e
Reviewed-on: https://code.wireshark.org/review/2920
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-08 03:45:31 +00:00
Alexis La Goutte e82e137bf1 Fix Dereference of null pointer found by Clang analyzer
after change of ga67b7f5b5

Change-Id: I03155b46dc35274915f7a7c16fad81f97e0dc5bf
Reviewed-on: https://code.wireshark.org/review/2911
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-08 03:40:40 +00:00
Alexis La Goutte 390e9bb5db Fix Dereference of null pointer found by Clang analyzer
Change-Id: I050c187acdb4c97bb164cefee67f65b69d7e6782
Reviewed-on: https://code.wireshark.org/review/2914
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-08 03:40:00 +00:00
Bill Meier cdf6d62b3b tools/pre-commit: Complete all checks on all files before exiting with Ok/Fail status.
Change-Id: Iea6df6fbe5a977b282e823f87cd9f760e92a3e22
Reviewed-on: https://code.wireshark.org/review/2918
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-08 00:49:47 +00:00
Gerald Combs 858558e619 Update README.qt and add todo items.
Change-Id: I69c080253cf7e861c575573e74a66b83e014cbb0
Reviewed-on: https://code.wireshark.org/review/2925
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-07-07 22:12:09 +00:00
AndersBroman 1ff6213c94 Try to fix cast discards '__attribute__((const))' qualifier from pointer
target type

Change-Id: If7efc629247480fbfb231b965a358803b67e1504
Reviewed-on: https://code.wireshark.org/review/2919
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-07 15:16:54 +00:00
AndersBroman 4ac9895884 See if yhis fixes "cast discards '__attribute__((const))' qualifier from
pointer target type"

Change-Id: I0f97b119f1e6151622d360464f12ad399cbaf117
Reviewed-on: https://code.wireshark.org/review/2917
Tested-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-07 14:34:27 +00:00
Martin Mathieson 7801a97fd8 Trying to create and use an empty tvb now throws an exception. Just pass current tvb to mac-lte dissector.
Change-Id: I4aa24342192ec079254f26e00317470377c3e20b
Reviewed-on: https://code.wireshark.org/review/2916
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-07-07 10:42:14 +00:00
Alexis La Goutte 3c638d8bf8 Fix Branch condition evaluates to a garbage value found by Clang Analyzer
Change-Id: I2cb4fb8064c80ee7985c3908820f09f5fa7e37fb
Reviewed-on: https://code.wireshark.org/review/2913
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-07 10:25:20 +00:00
Роман Донченко 4ce4e3a41e make-dissector-reg: minor tweaks
* use grep -c instead of a grep/wc combo;
* use cmp instead of diff, since we're only interested in whether the files
  are identical;
* remove the temporary file if it's the same as the existing one.

Change-Id: If61c5675535c483b9dc2aee179d7be58c7bd6e4f
Reviewed-on: https://code.wireshark.org/review/2894
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-07 07:24:24 +00:00
Gerald Combs 4cdd17a59d Qt: Cache packet list column strings.
For each displayed packet list row, save a copy of or a pointer to
column strings similar to ui/gtk/packet_list_store.c. This lets us call
epan_dissect_run only once per row.

Bug: 9511
Change-Id: I17e8ebeb5ed70518c9047413c3b2a46f01e904ef
Reviewed-on: https://code.wireshark.org/review/2752
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-07 06:24:23 +00:00
Guy Harris 593878299d Don't cast away constness if not necessary.
Change-Id: I5f6ecd246e358edc3a2f4963c201b2435e4a1a42
Reviewed-on: https://code.wireshark.org/review/2910
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-07 04:46:45 +00:00
Guy Harris e286acd05f Squelch compiler warning.
Change-Id: I37c495cb4d68b95d8388c654bbf6a817167261ac
Reviewed-on: https://code.wireshark.org/review/2909
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-07 04:34:34 +00:00
Guy Harris 9dfb3e7b46 Wrong macro.
Change-Id: I2e0e7c1a30c9fc2d5af7cbd53dae26ad9a619e71
Reviewed-on: https://code.wireshark.org/review/2908
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-07 04:32:11 +00:00
Guy Harris eea2e15638 G_GNUC_FORMAT encapsulates __attribute((format_arg(...))).
Change-Id: I9513c187ae4ce8b8cf8f6a926072b215e26ec64f
Reviewed-on: https://code.wireshark.org/review/2907
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-07 04:29:41 +00:00
Peter Wu aa4066dccf skinny: fix retval, convert from tvb_length
New dissectors return an integer, not a boolean, fix that.

Change-Id: I79dea0cc4274d503d61ce8823dc783c542764f6b
Reviewed-on: https://code.wireshark.org/review/2884
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-07 01:46:59 +00:00
Guy Harris 0a2f6fc01a Squelch some compiler warnings.
Change-Id: I768bf577b3871171ab33f080c5a0099ac06718ce
Reviewed-on: https://code.wireshark.org/review/2906
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-07 00:11:59 +00:00
Michael Mann 4d58904a09 convert to proto_tree_add_subtree[_format]
Change-Id: Ie10ac4f5f04a23344d183e095bbafb23c6409144
Reviewed-on: https://code.wireshark.org/review/2904
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-07 00:03:35 +00:00
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