aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dcerpc.c
AgeCommit message (Collapse)AuthorFilesLines
2020-01-22packet-dcerpc: pass down header/trailer for hdr_signingStefan Metzmacher1-3/+101
Change-Id: I1d14ffe928e1b303eee7e95a45a9617ffcfb151b Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-on: https://code.wireshark.org/review/35707 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-04Get rid of proto_tree_add_debug_text() callsPascal Quantin1-7/+9
This function should not be used for anything else than debug, as stated in its name. Bug: 15989 Change-Id: Ie2a99f3487169fcf2d00c06e7fc5d61086f32969 Reviewed-on: https://code.wireshark.org/review/34954 Petri-Dish: Pascal Quantin <pascal@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2019-08-27DCERPC: workaround that pidl always emits dissect_deferred_pointers()Ralph Boehme1-2/+7
Commit f57cf9e56c90c0c0c724f415eff35821afaaf849 introduced a DISSECTOR_ASSERT() that revealed a deficiency in pidl: currently pidl unconditionally adds calls to dissect_deferred_pointers() which breaks dissecting any RPC function that has only scalar arguments: Warn Dissector bug, protocol RPCMDSSVC, in packet 51: epan/dissectors/packet-dcerpc.c:2940: failed assertion "list_ndr_pointer_list" Bug: 16022 Change-Id: I9d3522a3e17ef79b9a8a5acb018104ab398a512a Reviewed-on: https://code.wireshark.org/review/34364 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-27HTTPS In Still More Places, update more URLs.Guy Harris1-8/+9
Microsoft reshuffled their documentation - almost all of it moved from msdn.microsoft.com to docs.microsoft.com. Some blogs moved to devblogs.microsoft.com; the comments *didn't* move, so in one case we go to the Wayback Machine - the link isn't dead, but it formats horribly, at least on my browser, but the archived version formats OK. Use the Wayback Machine for some URLs, and update others. Update the sections for MS-ADTS. Point to the HTML versions of some RFCs and I-Ds. Change-Id: I344b20f880de63f1ae2a4e3f9ff98af78a7fe139 Reviewed-on: https://code.wireshark.org/review/34101 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-06-11decode_as: remove the "title" member from decode_as_tMartin Kaiser1-1/+1
The title of a decode_as_t was used by the GTK UI. It's no longer required for Qt. Change-Id: Ibd9d4acbe9cad2c1af520340d04e550326a97ebe Reviewed-on: https://code.wireshark.org/review/33557 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04epan: Convert our PROTO_ITEM_ macros to inline functions.Gerald Combs1-19/+19
Convert our various PROTO_ITEM_ macros to inline functions and document them. Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c Reviewed-on: https://code.wireshark.org/review/32706 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-17Constification, to remove some compiler warnings.Guy Harris1-2/+2
Change-Id: I24f0bdc72109a6ef3d801dc28cb9b523ff4e5fe7 Reviewed-on: https://code.wireshark.org/review/32458 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-20DCERPC: fix parsign of big endian UTF-16 stringJiajun Wang1-12/+2
Change-Id: I560afb78bd3a06fd4f8a2d619dc2ff3bd6567a52 Reviewed-on: https://code.wireshark.org/review/32099 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-01Add a "failed" return for tap packet routines.Guy Harris1-7/+7
This allows taps that can fail to report an error and fail; a failed tap's packet routine won't be called again, so they don't have to keep track of whether they've failed themselves. We make the return value from the packet routine an enum. Don't have a separate type for the per-packet routine for "follow" taps; they're expected to act like tap packet routines, so just use the type for tap packet routines. One tap packet routine returned -1; that's not a valid return value, and wasn't one before this change (the return value was a boolean), so presume the intent was "don't redraw". Another tap routine's early return, without doing any work, returned TRUE; this is presumably an error (no work done, no need to redraw), so presumably it should be "don't redraw". Clean up some white space while we're at it. Change-Id: Ia7d2b717b2cace4b13c2b886e699aa4d79cc82c8 Reviewed-on: https://code.wireshark.org/review/31283 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-27Try to squeeze some bytes out of the frame_data structure.Guy Harris1-12/+12
Make the time stamp precision a 4-bit bitfield, so, when combined with the other bitfields, we have 32 bits. That means we put the flags at the same structure level as the time stamp precision, so they can be combined; that gets rid of an extra "flags." for references to the flags. Put the two pointers next to each other, and after a multiple of 8 bytes worth of other fields, so that there's no padding before or between them. It's still not down to 64 bytes, which is the next lower power of 2, so there's more work to do. Change-Id: I6f3e9d9f6f48137bbee8f100c152d2c42adb8fbe Reviewed-on: https://code.wireshark.org/review/31213 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-12DCERPC: fix memleak by removing dummy element from ndr_pointer_listPeter Wu1-30/+27
Instead of creating the pointers list early, defer it to the point when a new list item is added. This avoids the need for a dummy element. This happens to fix the memory leak in bug 14735 as well (verified with both ASAN and valgrind). Change-Id: I3b169dfc447bd7465d06c26e0bd9dfd4225b1307 Bug: 14735 Reviewed-on: https://code.wireshark.org/review/30115 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-12DCERPC: simplify pointer list trackingPeter Wu1-31/+20
Observe that the "current_depth" and "len_ndr_pointer_list" just track the length of the current singly linked list in order to insert (append) or remove [the last] element (a linked list of lists and a linked list of pointers respectively). Replace these callers by equivalents that do not require explicit length tracking, internally they both have to do a O(n) lookup anyway. There used to be a case where "current_depth" could run out-of-sync, no longer tracking the actual list length: when the callback (tnpd->fnct or tnpd->callback) triggers an exception. I believe this was unintentional. No functional change intended, but this should make further changes to the data structures easier. Change-Id: I3cb13aba22caa87dc7baba411cf34f47792f7bb7 Ping-Bug: 14735 Fixes: v2.5.0rc0-292-g6bd87bdd5d ("dcerpc: improve greatly the speed of processing of DCERPC packets") Reviewed-on: https://code.wireshark.org/review/30114 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-11DCERPC: remove unused variable and mark another global as staticPeter Wu1-4/+1
dcerpc_hooks_init_protos is unused since v1.11.3-rc1-34-g01c8945438. uuid_dissector_table was added in v2.1.0rc0-391-ge0e574d167 and was not used outside the file, so mark it as static. Change-Id: I6113fbaf1f2e2e6241b91b659711986d6e6ded66 Reviewed-on: https://code.wireshark.org/review/30116 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-07-04Distinguish between "reserved for implementation" and "reserved for future use".Guy Harris1-15/+15
Some flags in the connectionless PDU header are "reserved for implementation", which presumably means an implementation can set them to 0 or 1 and use it to send information to a compatible implementation; others are "reserved for future use" and "must be set to 0". Don't test the "reserved for implementation" flags in the heuristic, and show them as "Reserved for implementation" and show the others as "Reserved for future use (MBZ)". Bug: 14942 Change-Id: Iff40f155e057301096fec1dbb68f71d041508ff1 Reviewed-on: https://code.wireshark.org/review/28598 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-13Get rid of some GTK+-only stuff.Guy Harris1-3/+3
Change-Id: I841a1cdb637f37673466e4d065474c0f7e2dfc56 Reviewed-on: https://code.wireshark.org/review/27512 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-16glib: Get rid of GLIB_CHECK_VERSION as we now require 2.32.0Anders1-1/+0
Change-Id: Ie95cf37f9cd283545693e290340a7489cc989c95 Reviewed-on: https://code.wireshark.org/review/26970 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-17dcerpc_decode_as_change() doesn't need to change the old binding.Guy Harris1-8/+8
The search doesn't use the fields we change (if it did, we probably shouldn't change them, as the old binding might not be found), so don't change them. Instead, when we allocate a *new* binding structure, put the new values into *that* structure. Squelches a "casting away constness" warning. Change-Id: I6dbd1a4cbc2415373f4926f443f9756c8113c0be Reviewed-on: https://code.wireshark.org/review/25841 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-18dcerpc: remove use-after-free (found by clang).Dario Lombardo1-1/+1
Change-Id: I6db7e47fc5e67afcad78763cb739a3f13a47b923 Reviewed-on: https://code.wireshark.org/review/25352 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2017-10-29Add conversation endpoint typeMichael Mann1-2/+2
For the moment this mirrors the port_type enumeration (PT_XXX), but the intent is to move away from using "port types", eliminating most (if not all) Added conversation_pt_to_endpoint_type() so that conversations deal with the correct enumeration. This is for dissector that use pinfo->ptype as input to conversation APIs. Explicit use of port types are converted to using ENDPOINT_XXX type. Change-Id: Ia0bf553a3943b702c921f185407e03ce93ebf0ef Reviewed-on: https://code.wireshark.org/review/24166 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-28Convert to using find_conversation_pinfo where appropriateMichael Mann1-6/+3
This makes it easier to identify the simpler/common conversations Change-Id: I7094f23e49156ee27f5f72c8e130308470f3e462 Reviewed-on: https://code.wireshark.org/review/24145 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-26Add a ws_in6_addr typedef for struct e_in6_addr.Guy Harris1-1/+1
That allows a parallel typedef of ws_in4_addr for guint32. Change-Id: I03b230247065e0e3840eb87635315a8e523ef562 Reviewed-on: https://code.wireshark.org/review/24073 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-15Remove superfluous null-checks before strdup/freeAhmad Fatoum1-5/+2
NULL checks were removed for following free functions: - g_free "If mem is NULL it simply returns" https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free - g_slist_free(_full)? "NULL is considered to be the empty list" https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html - g_strfreev "If str_array is NULL, this function simply returns." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev - g_slice_free "If mem is NULL, this macro does nothing." https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free - g_match_info_free "not NULL... otherwise does nothing" https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free - dfilter_free defined in Wireshark code. Returns early when passed NULL epan/dfilter/dfilter.c They were also removed around calls to g_strdup where applicable: - g_strdup "If str is NULL it returns NULL." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04 Reviewed-on: https://code.wireshark.org/review/23406 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-24Replace DISSECTOR_ASSERT(hfinfo->type == FT_STRING) with ↵Guy Harris1-2/+2
DISSECTOR_ASSERT_FIELD_TYPE. That produces better error messages, giving the name of the offending field. Change-Id: I155ac29c68ecd7811cc9752980db9cdc37fea72e Reviewed-on: https://code.wireshark.org/review/23685 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-07-09packet-dcerpc: move auth information into a subtreeStefan Metzmacher1-0/+31
Change-Id: I0e5d3967a26b79c899b0d219317e2963969cba6b Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-on: https://code.wireshark.org/review/17809 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-09packet-dcerpc: improve the dissection of DCERPC Fault pdusStefan Metzmacher1-16/+56
Change-Id: I70786cc561d248529167445e12190159d818ebcb Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-on: https://code.wireshark.org/review/17811 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2017-07-06Ensure expert info fields have a summary.D. Ulis1-10/+10
It's not a requirement, but some dissectors didn't provide a static summary because expert "format" was used. While at it, fix a misleading expert info description, rename expert info variables to ei_... and remove an unused hf entry. Change-Id: Ib81a0d0a3950b3c90954d0053b8dae49dbb0cd51 Reviewed-on: https://code.wireshark.org/review/20567 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-27dcerpc: improve greatly the speed of processing of DCERPC packetsMatthieu Patou1-42/+140
Instead of using one big linked list, we use a stack of list once all the pointers of one level have been handled the list is removed from the stack and we go to the level before. Because of this the lists are much smaller and far less CPU is spent iterating on the objects or inserting objects in the list Bug: 10544 Change-Id: I432aaf5b4b781411c92da92abe9c5503034b65dc Reviewed-on: https://code.wireshark.org/review/4598 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-05Add DCE/RPC over TCP dissector to "force" DCE/RPC when heuristics failMichael Mann1-2/+19
Add a simple dissection function for DCE/RPC that just calls tcp_dissect_pdus and doesn't do any heuristics checks. This can be used to handle cases where TCP PDU is too small for DCE/RPC heuristics checks and user knows the data is DCE/RPC and can set it through Decode As. Bug: 6392 Change-Id: I9e4960282ea64d20499f7d5a330f48f30a092b30 Reviewed-on: https://code.wireshark.org/review/21951 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-02GHashtable -> wmem_map conversionsMichael Mann1-53/+39
Many of the register_init_routine/register_cleanup_routine functions are for initializing and cleaning up a GHashtable. wmem_map_new_autoreset can do that automatically, so convert many of the simple cases. Change-Id: I93e1f435845fd5a5e5286487e9f0092fae052f3e Reviewed-on: https://code.wireshark.org/review/19912 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-29Register reassembly tablesMichael Mann1-15/+11
Register all reassembly tables with a central unit, allowing the central unit to have the callback that initializes and destroys the reassembly tables, rather than have dissectors do it individually. Change-Id: Ic92619c06fb5ba6f1c3012f613cae14982e101d4 Reviewed-on: https://code.wireshark.org/review/19834 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-21dcerpc: add shutdown routine.Dario Lombardo1-1/+18
Also use g_hash_table_new_full to ease the free procedure. Change-Id: I0a411cccbd651cca18e94a048722bf5520903deb Reviewed-on: https://code.wireshark.org/review/19691 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-10Rename tvb_new_subset() to tvb_new_subset_length_caplen().Guy Harris1-6/+6
This emphasizes that there is no such thing as *the* routine to construct a subset tvbuff; you need to choose one of tvb_new_subset_remaining() (if you want a new tvbuff that contains everything past a certain point in an existing tvbuff), tvb_new_subset_length() (if you want a subset that contains everything past a certain point, for some number of bytes, in an existing tvbuff), and tvb_new_subset_length_caplen() (for all other cases). Many of the calls to tvb_new_subset_length_caplen() should really be calling one of the other routines; that's the next step. (This also makes it easier to find the calls that need fixing.) Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b Reviewed-on: https://code.wireshark.org/review/19597 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-11-03RTS_FLAG_NONE is a flags field value, but it's not a flag bit.Guy Harris1-5/+7
It's the *absence* of flag bits, so you can't test whether it's set; don't have a field for it. This gets rid of a dissector assertion. Add some more URLs for information about DCE RPC and MS-RPC. Change-Id: I53e8f11692c66e16ae2ec7fd4ba8eb90b0673da4 Reviewed-on: https://code.wireshark.org/review/18648 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-23packet-dcerpc: let dissect_dcerpc_cn_auth() always dissect the whole auth_infoStefan Metzmacher1-138/+101
As all this information belongs together I'm moving it into a subtree. Change-Id: I839a5a6294360976a78b4b43f219e30381b4f516 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-on: https://code.wireshark.org/review/17878 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-20packet-dcerpc: dissect the auth verifier of PDU_CO_CANCEL, PDU_ORPHANED and ↵Stefan Metzmacher1-0/+3
PDU_FAULT Change-Id: I28325d655ccd5d363aac89e49e5333b3d75f68a2 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-on: https://code.wireshark.org/review/17810 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-20packet-dcerpc: The opnum field is generated for PDU_RESP and PDU_FAULTStefan Metzmacher1-2/+4
Change-Id: Ieeb9de0f54a22afc3adcd52d8af2c45e8b82b0ab Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-on: https://code.wireshark.org/review/17808 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-20packet-dcerpc: nca_s_fault_sec_pkg_errorStefan Metzmacher1-0/+1
Change-Id: I951a317da795c94ac6518be73cb2c836e7afb836 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-on: https://code.wireshark.org/review/17807 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-19Improve support for single-character fields and filter expressions.Guy Harris1-0/+20
Add an FT_CHAR type, which is like FT_UINT8 except that the value is displayed as a C-style character constant. Allow use of C-style character constants in filter expressions; they can be used in comparisons with all integral types, and in "contains" operators. Use that type for some fields that appear (based on the way they're displayed, or on the use of C-style character constants in their value_string tables) to be 1-byte characters rather than 8-bit numbers. Change-Id: I39a9f0dda0bd7f4fa02a9ca8373216206f4d7135 Reviewed-on: https://code.wireshark.org/review/17787 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-31Don't do any Decode As stuff for dissector tables not used with Decode As.Guy Harris1-1/+1
Have all dissector tables have a "supports Decode As" flag, which defaults to FALSE, and which is set to TRUE if a register_decode_as() refers to it. When adding a dissector to a dissector table with a given key, only add it for Decode As if the dissector table supports it. For non-FT_STRING dissector tables, always check for multiple entries for the same protocol with different dissectors, and report an error if we found them. This means there's no need for the creator of a dissector table to specify whether duplicates of that sort should be allowed - we always do the check when registering something for "Decode As" (in a non-FT_STRING dissector table), and just don't bother registering anything for "Decode As" if the dissector table doesn't support "Decode As", so there's no check done for those dissector tables. Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed Reviewed-on: https://code.wireshark.org/review/17402 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-14dcerpc: Check dissect_ndr_ucvarray_core when looping over elements that ↵Michael Mann1-0/+4
we're incrementing offset. Bug: 12720 Change-Id: Ib9c9eb2e60c35b23b4c6b4898b036bcdc442fc84 Reviewed-on: https://code.wireshark.org/review/17041 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-13dcerpc: don't THROW() an exception from a dissectorMartin Kaiser1-17/+12
remove the checks in dissect_ndr_ucarray_core() where a block or bytes dissection function is called and an exception is thrown if the offset wraps around, i.e. the final offset is lower than the initial one the block functions eventually call proto_tree_add_item(), which throws an exception if necessary the bytes functions end up calling functions to dissect basic types. insert calls to tvb_ensure_bytes_exist() if those functions increase our offset without reading data. thus, an exception is thrown if there's an overflow. remove some unnecessary if (tree) checks while at it Change-Id: I8006399ae20934daeec231246debe247f8dedbf0 Reviewed-on: https://code.wireshark.org/review/15832 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-22Do not mix wmem and glib allocatorsPascal Quantin1-2/+2
Change-Id: I0e845668a1b9dbec93ea920a8585ecfe60f001d1 Reviewed-on: https://code.wireshark.org/review/15044 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-03-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-1/+1
This will make it easier to determine protocol dependencies. Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used) Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d Reviewed-on: https://code.wireshark.org/review/14446 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-26Add free_address_wmem(), fix warnings [-Wcast-qual]João Valverde1-8/+8
Try to improve address API and also fix some constness warnings by not overloading the 'data' pointer to store malloc'ed buffers (use private pointer for that instead). Second try, now passing test suite. Change-Id: Idc101cd866b6d4f13500c9d59da5c7a38847fb7f Reviewed-on: https://code.wireshark.org/review/13946 Petri-Dish: João Valverde <j@v6e.pt> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-02-22Separate hf_ fields that share filter names with FT_UINT32 and FT_UINT64 ↵Michael Mann1-2/+2
datatypes. 'bitcoin.addr.count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.inv.count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.getdata.count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.notfound.count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.getblocks.count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.getheaders.count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.tx.input_count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.tx.in.script_length' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.tx.output_count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.tx.out.script_length' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.block.num_transactions' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.headers.count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.merkleblock.flags.count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.merkleblock.hashes.count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.string.count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'bitcoin.data.count' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'dcerpc.referent_id' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'dmp.body.id' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'edonkey.start_offset' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'edonkey.end_offset' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.entry' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.phoff' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.shoff' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.p_offset' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.p_vaddr' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.p_paddr' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.p_filesz' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.p_memsz' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.p_align' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.sh_addr' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.sh_offset' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.sh_size' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.sh_addralign' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.sh_entsize' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.symbol_table.value' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.symbol_table.size' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.dynamic.tag' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.dynamic.value' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.dynamic.pointer' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.dynamic.ignored' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'elf.dynamic.unspecified' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'h248.contextId' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'hcrt.data32' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'wlan_mgt.fixed.psmp.stainfo.reserved' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'isakmp.tf.attr.life_duration' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'isakmp.ike.attr.life_duration' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'jxta.message.element.content.length' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'rmt-lct.tsi' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'rmt-lct.toi' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'smb.alloc_size' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 'trmac.response_code' exists multiple times with NOT compatible types: FT_UINT64 and FT_UINT32 Change-Id: I903933e6448bac3d3374eef1a6a0bc4771c1a9f4 Reviewed-on: https://code.wireshark.org/review/14060 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-19dcerpc: fix Called function pointer is null (null dereference) found by ↵Alexis La Goutte1-1/+1
Clang Analyzer Change-Id: Idf98bcf617d4d6343aa233e42898cf5f26b08e33 Reviewed-on: https://code.wireshark.org/review/13974 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-16const gpointer -> gconstpointerJoão Valverde1-3/+3
'const gpointer' is the same as 'void *const'. Replace with gconstpointer where straightforward (assuming that was the intent) and use gpointer everywhere else for clarity (that does not change *API* constness contract; it just means a variable is not declared immutable inside the called funtion). Change-Id: Iad2ef13205bfb4ff0056b2bce056353b58942267 Reviewed-on: https://code.wireshark.org/review/13945 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-14Fix format string warnings [-Wformat=]João Valverde1-1/+1
Change-Id: I266c7d422f6ade965b42a4e2e8dc01966f8eb5f8 Reviewed-on: https://code.wireshark.org/review/13932 Reviewed-by: João Valverde <j@v6e.pt>