aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ncp2222.inc
AgeCommit message (Collapse)AuthorFilesLines
2014-10-25ncp2222: initialize buffer in build_expert_dataEvan Huus1-0/+1
We do a bunch of conditional logic to fill in the buffer, and then were checking strlen(buffer) to see if we'd actually filled it in or not, but if we hadn't then the buffer was garbage and strlen(buffer) was throwing valgrind warnings. Ensure this works as intended by setting the first byte of the buffer unconditionally at the beginning, so strlen(buffer) returns 0 as expected in that case. Bug: 10628 Change-Id: I6f6c29fbbcb601b6ebccb3a4b312f0fa72c169ae Reviewed-on: https://code.wireshark.org/review/4924 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-10-13NCP: cast to guint instead of gulongPascal Quantin1-1/+1
Change-Id: Idc8f8f3177703ce5546b8a472034705cb6070707 Reviewed-on: https://code.wireshark.org/review/4666 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-13NCP: add a missing cast following g6ca40c5Pascal Quantin1-1/+1
Change-Id: I0b93c4faab52d830b8160d89b9bb8026ab2a216e Reviewed-on: https://code.wireshark.org/review/4657 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-13ncp2222: don't overflow buffer constructing stringEvan Huus1-2/+1
Fixes stack-smashing vuln. Somehow there was already an XXX in the code about this, but nobody realized at the time it was worth fixing... really? Bug: 10552 Change-Id: I849068bd6c45146339444f295b72430d3c6e08f2 Reviewed-on: https://code.wireshark.org/review/4653 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-10-10NCP: switch to wmem memory and ensure that all fields are initializedPascal Quantin1-7/+7
Change-Id: Ia17e189baed05d8020654e6702a51f51bd384f26 Reviewed-on: https://code.wireshark.org/review/4589 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-06Add printf-format annotations, fix garbagePeter Wu1-0/+14
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-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-34/+34
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-34/+34
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-16Convert a bunch of time_to_str functions to wmemEvan Huus1-20/+40
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983 Reviewed-on: https://code.wireshark.org/review/2245 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-02-21Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-43/+43
Change-Id: I329fd1cec092e425dd0f6c2c1992d278dcdba743 Reviewed-on: https://code.wireshark.org/review/293 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2013-12-19Rename more to_str functions to have ep_ in the name if they return ephemeralEvan Huus1-20/+20
buffers. Remove two unused functions. svn path=/trunk/; revision=54250
2013-12-19Rename a couple of to_str functions to have ep_ in the name. This makes itEvan Huus1-3/+3
obvious that the returned string is ephemeral, and opens up the original names in the API for versions that take a wmem pool (and thus can work in any scope). svn path=/trunk/; revision=54249
2013-12-14Remove not needed ';'Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=54088
2013-11-23Create the ability to have packet scoped "proto" data. Bug 9470 ↵Michael Mann1-6/+6
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470) I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future. And search/replace of a function name is easy enough to do. The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As. All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope(). All other dissectors were converted to using file_scope() which was the original scope for "proto" data. svn path=/trunk/; revision=53520
2013-09-29Convert proto_tree_add_time_format to either proto_tree_add_time or ↵Michael Mann1-4/+2
proto_tree_add_time_format_value. Only proto_tree_add_time_format calls remaining are in packet-ncp2222.inc, which may just need some additional filters. svn path=/trunk/; revision=52269
2013-09-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-15/+15
svn path=/trunk/; revision=51852
2013-09-08Restore some format arguments that were accidentally dropped.Evan Huus1-3/+3
svn path=/trunk/; revision=51838
2013-09-08Add filterable expert info to NCP dissector.Michael Mann1-25/+20
svn path=/trunk/; revision=51833
2013-07-22The last argument to ptvcursor_add() is an encoding value; pass it one,Guy Harris1-6/+11
not a Boolean endianness value. svn path=/trunk/; revision=50803
2013-07-17Remove fragment_data, add fragment_head, fragment_item - for now alias it to ↵Jakub Zawadzki1-1/+1
the same structure. This is begin of work to split fragment head and fragments items. svn path=/trunk/; revision=50708
2013-07-14Rewrite reassemble API to use TVBs instead of raw data.Jakub Zawadzki1-2/+1
(it seems to be working for TCP ^^) svn path=/trunk/; revision=50580
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-79/+56
This leaves just the Pidl dissectors remaining for removal of check_col() in the dissectors directory. A small handful of check_col() calls remain outside of the dissectors. svn path=/trunk/; revision=49941
2013-05-12Add the posibillity to use a key for per-packet-data.Anders Broman1-5/+5
svn path=/trunk/; revision=49259
2013-03-22Don't wire into the reassembly code the notion that reassemblies shouldGuy Harris1-5/+8
be done on flows from one address to another; reassembly for protocols running atop TCP should be done on flows from one TCP endpoint to another. We do this by: adding "reassembly table" as a data structure; associating hash tables for both in-progress reassemblies and completed reassemblies with that data structure (currently, not all reassemblies use the latter; they might keep completed reassemblies in the first table); having functions to create and destroy keys in that table; offering standard routines for doing address-based and address-and-port-based flow processing, so that dissectors not needing their own specialized flow processing can just use them. This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where the second YPALL response is processed as if it were a continuation of a previous response between different endpoints, even though said response is already reassembled), and also allows the DCE RPC-specific stuff to be moved out of epan/reassembly.c into the DCE RPC dissector. svn path=/trunk/; revision=48491
2013-03-18From beroset:Anders Broman1-13/+13
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48384
2013-02-15Fix a set of obscure bugs found by checkhf.Bill Meier1-16/+16
svn path=/trunk/; revision=47666
2012-12-26Fix a bunch of warnings.Guy Harris1-27/+27
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
2012-12-04Fix 2 [-Wshadow] warnings.Bill Meier1-7/+7
svn path=/trunk/; revision=46369
2012-10-10Provide ability to find previous request packets in NCP hash table.Greg Morris1-2/+25
svn path=/trunk/; revision=45447
2012-09-27Fix for buildbot warning on OSX-10.6-x64Greg Morris1-1/+1
svn path=/trunk/; revision=45178
2012-09-27Added additional server information in NCP 23/17 reply structure for OES Linux.Greg Morris1-32/+70
Fixed GTKHash table being overwritten when number of NCP packets exceeds 255. Sequence numbers wrap so this was causing the request value table to be overwritten and subsequent malformed NCP packets. Fixed buid_expert_data for file open reporting to correctly convert to Hex value so proper lookup in val table will succeed. Added additional OES Linux values to build_expert_data for server entries. svn path=/trunk/; revision=45177
2012-09-07From Robert Bullen via ↵Jeff Morriss1-0/+2
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7683 : The reassembled fragments tree in the Packet Details view is awesome, but it lacks one thing: a field that exposes the reassembled data. tcp.data already exists for exposing a single TCP segment's payload as a byte array. It would be handy to have something similar for a single application layer PDU when TCP segment reassembly is involved. I propose tcp.reassembled.data, named and placed after the already existing field tcp.reassembled.length. My primary use case for this feature is outputting tcp.reassembled.data with tshark for further processing with a script. The attached patch implements this very feature. Because the reassembled fragment tree code is general purpose, i.e. not specific to just TCP, any dissector that relies upon it can add a similar field very cheaply. In that vein I've also implemented ip.reassembled.data and ipv6.reassembled.data, which expose reassembled fragment data as a single byte stream for IPv4 and IPv6, respectively. All other protocols that use the reassembly code have been left alone, other than inserting NULL into their initializer lists for the newly introduced struct field reassemble.h:fragment_items.hf_reassembled_data. svn path=/trunk/; revision=44802
2012-09-01Remove duplicate assignment (caught by cppcheck).Evan Huus1-1/+0
svn path=/trunk/; revision=44729
2012-08-10Make the corresponding packet_info available to each tree item. ThisGerald Combs1-4/+3
lets us pass a NULL pinfo to expert_add_info_format() and expert_add_undecoded_item(), which makes it possible to use those routines deep in the bowels of many dissectors. As a proof of concept remove the recent pinfo additions to packet-afp.c. This should also make it easier to fix bug 3884. svn path=/trunk/; revision=44435
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2011-07-15Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings.Bill Meier1-14/+4
svn path=/trunk/; revision=38049
2011-05-17As suggested by Chris: use val_to_str_const() instead of match_strval() plus aJeff Morriss1-312/+89
NULL-return check. Use val_to_str_const instead of val_to_str() in a couple places where the string is constant. Use val_to_str() instead of blindly passing the return value from match_strval() into a format routine (to ensure a non-NULL string pointer). svn path=/trunk/; revision=37202
2011-05-17Avoid passing a NULL string pointer to format routines: some libc's (e.g.,Jeff Morriss1-4/+8
Solaris') will seg-fault on that. svn path=/trunk/; revision=37201
2011-04-12Don't assign to a proto_item * if the value won't be used: Coverity 978;Bill Meier1-29/+32
Use what appears to be the intended correct tree for various proto_add...: Coverity 979; Minor indentation cleanup. svn path=/trunk/; revision=36594
2011-02-19Fix Visual C++ code analysis warnings.Gerald Combs1-1/+1
svn path=/trunk/; revision=36007
2011-01-30Introduce "Fragment count" filter element for all protocols doing reassembly.Stig Bjørlykke1-0/+1
svn path=/trunk/; revision=35705
2010-12-17Switched to bitwise & instead of logical && in bit operations.Stig Bjørlykke1-2/+2
This bug was found by clang. svn path=/trunk/; revision=35210
2010-11-01Compile (over 100) dfilters only if needed rather than at every Wireshark ↵Bill Meier1-1/+27
startup; Also: Minor whitespace cleanup. svn path=/trunk/; revision=34747
2010-10-10Define some fcns & vars as static...Bill Meier1-8/+8
svn path=/trunk/; revision=34459
2010-06-09Do some constifying (based upon gcc -Wwrite-strings warnings);Bill Meier1-80/+95
Use #if 0/#endif instead of /* ... */ to comment out code.. svn path=/trunk/; revision=33176
2010-05-21Have abs_time_to_str() and abs_time_to_str_secs() take an additionalGuy Harris1-22/+22
argument indicating whether to include the time zone in the string. If we're constructing a display filter, don't include the time zone, otherwise do. Fixes bug 4756. svn path=/trunk/; revision=32913
2010-02-27Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with theGuy Harris1-22/+22
date as YYYY/DDD, where DDD is a 1-origin day of year. Move the formats to a "time_fmt.h" file, included by the headers that use it. Have abs_time_to_str() and abs_time_secs_to_str() take the date format value, rather than a Boolean "show this as UTC" flag, as an argument. Document the ABSOLUTE_TIME_ formats a bit better. Use that format in the CCSDS and VCDU dissectors, rather than having those dissectors do the formatting themselves. svn path=/trunk/; revision=32034
2010-02-02Introduce "Reassembled length" filter element for all protocols doingStig Bjørlykke1-0/+1
reassembly. svn path=/trunk/; revision=31767
2009-12-10Add an argument to abs_time_to_str() and abs_time_secs_to_str()Guy Harris1-22/+22
indicating whether the time should be shown as local time or UTC. For now, always pass FALSE, meaning "show as local time". Clean up some stuff in the SNMP dissector, use abs_time_secs_to_str() for times with one-second resolution, and update a comment in various macros in the WSP dissector, while we're at it. svn path=/trunk/; revision=31227