summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-gsm_cbch.c
AgeCommit message (Collapse)AuthorFilesLines
2017-01-29Register reassembly tablesMichael Mann1-15/+3
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>
2016-03-29GSM CBCH: fix an out of bounds accessPascal Quantin1-6/+6
As explained by Guy, we should use new_slots[i] and not new_slots[k] Bug: 12278 Change-Id: Ifae44f9d5948bed5c4ee0442510724016e307dee Reviewed-on: https://code.wireshark.org/review/14678 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-03-20Create call_data_dissector() to call data dissector.Michael Mann1-5/+3
This saves many dissectors the need to find the data dissector and store a handle to it. There were also some that were finding it, but not using it. For others this was the only reason for their handoff function, so it could be eliminated. Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b Reviewed-on: https://code.wireshark.org/review/14530 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20Manually add protocol dependencies derived from find_dissector.Michael Mann1-1/+1
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector. Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector. "data" dissector was not considered to be a dependency. Change-Id: I15d0d77301306587ef8e7af5876e74231816890d Reviewed-on: https://code.wireshark.org/review/14509 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-14register_dissector -> new_register_dissectorMichael Mann1-3/+4
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I25fe6a0aac93980333217d007702799d16946563 Reviewed-on: https://code.wireshark.org/review/11816 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-08-15Eliminate proto_tree_add_text from GSM dissectors.Michael Mann1-21/+52
Change-Id: I36a3d15a4fa86847a83d1dbea40111d36d7cfd61 Reviewed-on: https://code.wireshark.org/review/10036 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>
2015-07-03Call reassembly_table_destroy for some dissectorsPeter Wu1-0/+7
This patch adds reassembly_table_destroy calls as cleanup function for dissectors which have a simple init routine that just calls reassembly_table_init (comments are ignored). The changes were automatically generated using https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=4cc0aec05dc67a51926a045e1955b7a956757b5e (with the if and assignment parsers disabled). The only difference from the autogenerated output is that the XXX comments from the init routines in smb-pipe and tds dissectors are kept. Change-Id: I64aedf7189877247282b30b0e0f83757be6199e7 Reviewed-on: https://code.wireshark.org/review/9222 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-23Deleting unneccessary #includes from dissectors.Martin Mathieson1-1/+0
Second batch (packet-eth.c -> packet-icmpv6.d). Will look at cleaning up and committing script afterwards. Change-Id: I14295758b81a59115d8c88899f166cc3d5d17594 Reviewed-on: https://code.wireshark.org/review/6013 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-08-21packet-gsm_cbch.c: various minor changesBill Meier1-10/+22
- tvb_length() --> tvb_reported_length(); - Use -1 for length arg in proto_tree_add_protocol_format(); - Remove unused 'for' loop increment which caused Windows warning: "C4701: potentially uninitialized local variable"; - Add editor modelines. Change-Id: I37833b750c100e333f4fa76d9465169be456d7c1 Reviewed-on: https://code.wireshark.org/review/3788 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-29convert to proto_tree_add_subtree[_format]Michael Mann1-4/+4
Change-Id: If110de1e0555637264f86f1508858d569871a9c7 Reviewed-on: https://code.wireshark.org/review/2675 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-2/+2
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-2/+2
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
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>
2013-12-19Makes "slot" filterable to pacify checkAPIs.plMichael Mann1-23/+41
svn path=/trunk/; revision=54276
2013-12-15Fix [-Wmissing-prototypes]Jakub Zawadzki1-0/+3
svn path=/trunk/; revision=54135
2013-12-11Fix an out of bounds access found by ASAN and reported by Alexis:Pascal Quantin1-1/+1
==21553==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffbc0b2a5e at pc 0x7fe8684147a3 bp 0x7fffbc0b2950 sp 0x7fffbc0b2948 READ of size 2 at 0x7fffbc0b2a5e thread T0 #0 0x7fe8684147a2 in dissect_schedule_message /home/alagoutte/wireshark-clang/epan/dissectors/packet-gsm_cbch.c:309 #1 0x7fe867ed70a9 in call_dissector_through_handle /home/alagoutte/wireshark-clang/epan/packet.c:512 #2 0x7fe867eda42c in call_dissector_only /home/alagoutte/wireshark-clang/epan/packet.c:2139 #3 0x7fe867ed70a9 in call_dissector_through_handle /home/alagoutte/wireshark-clang/epan/packet.c:512 #4 0x7fe867ed735b in dissector_try_uint_new /home/alagoutte/wireshark-clang/epan/packet.c:1030 #5 0x7fe868a3ebd4 in decode_udp_ports /home/alagoutte/wireshark-clang/epan/dissectors/packet-udp.c:411 #6 0x7fe868a41886 in dissect /home/alagoutte/wireshark-clang/epan/dissectors/packet-udp.c:747 #7 0x7fe867ed70a9 in call_dissector_through_handle /home/alagoutte/wireshark-clang/epan/packet.c:512 #8 0x7fe867ed6d03 in dissector_try_uint_new /home/alagoutte/wireshark-clang/epan/packet.c:1030 #9 0x7fe8684eaa1f in dissect_ip /home/alagoutte/wireshark-clang/epan/dissectors/packet-ip.c:2401 #10 0x7fe867ed70a9 in call_dissector_through_handle /home/alagoutte/wireshark-clang/epan/packet.c:512 #11 0x7fe867ed735b in dissector_try_uint_new /home/alagoutte/wireshark-clang/epan/packet.c:1030 #12 0x7fe868333e98 in dissect_ethertype /home/alagoutte/wireshark-clang/epan/dissectors/packet-ethertype.c:305 #13 0x7fe867ed707d in call_dissector_through_handle /home/alagoutte/wireshark-clang/epan/packet.c:508 #14 0x7fe867eda42c in call_dissector_only /home/alagoutte/wireshark-clang/epan/packet.c:2139 #15 0x7fe8683328ad in dissect_eth_common /home/alagoutte/wireshark-clang/epan/dissectors/packet-eth.c:472 #16 0x7fe867ed70a9 in call_dissector_through_handle /home/alagoutte/wireshark-clang/epan/packet.c:512 #17 0x7fe867ed735b in dissector_try_uint_new /home/alagoutte/wireshark-clang/epan/packet.c:1030 #18 0x7fe868382460 in dissect_frame /home/alagoutte/wireshark-clang/epan/dissectors/packet-frame.c:485 #19 0x7fe867ed70a9 in call_dissector_through_handle /home/alagoutte/wireshark-clang/epan/packet.c:512 #20 0x7fe867eda42c in call_dissector_only /home/alagoutte/wireshark-clang/epan/packet.c:2139 #21 0x7fe867ed5baf in call_dissector /home/alagoutte/wireshark-clang/epan/packet.c:2169 #22 0x7fe867eb6388 in epan_dissect_run_with_taps /home/alagoutte/wireshark-clang/epan/epan.c:329 #23 0x4a0ef9 in process_packet /home/alagoutte/wireshark-clang/tshark.c:3434 #24 0x49c985 in load_cap_file /home/alagoutte/wireshark-clang/tshark.c:3237 #25 0x7fe860e8ede4 in __libc_start_main /build/buildd/eglibc-2.17/csu/libc-start.c:260 #26 0x48586c in _start ??:? Address 0x7fffbc0b2a5e is located in stack of thread T0 at offset 126 in frame #0 0x7fe86841353f in dissect_cbch /home/alagoutte/wireshark-clang/epan/dissectors/packet-gsm_cbch.c:345 This frame has 2 object(s): [32, 80) 'new_slots.i' [128, 224) 'other_slots.i' <== Memory access at offset 126 underflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow ??:0 ?? svn path=/trunk/; revision=53934
2013-11-20As per suggestion of Mike Morrin viaEvan Huus1-1/+1
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9406 The GSM CBCH assertion should be <= 48 not <48. Fixes one of the failing assertions with the capture from that bug. svn path=/trunk/; revision=53453
2013-10-15Check the length *before* accessing the array, and cap theEvan Huus1-1/+7
length-retrieved-from-packet at the size of the array we have. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9270 svn path=/trunk/; revision=52616
2013-10-08Don't try and fetch the repeat value of slot 0, since it makes us underflow theEvan Huus1-1/+7
array we're accessing. Fixes the uninitialized value errors in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9243 svn path=/trunk/; revision=52445
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-06-01Fix an infinite loop in the GSM CBCH dissector.Evan Huus1-3/+13
The looping logic is a bit odd, and there was a case where we were never incrementing any of the multiple loop variables. I suspect the entire function could be simplified, but this commit fixes the hang and is better suited to backporting than anything complex. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8730 svn path=/trunk/; revision=49686
2013-03-22Don't wire into the reassembly code the notion that reassemblies shouldGuy Harris1-9/+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-01-31Comment out unused hf[] entries & etc.Bill Meier1-1/+3
(found by checkhf) svn path=/trunk/; revision=47389
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45017
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-07-31Updated GSM dissectors display filters per checkfiltername.plMichael Mann1-4/+4
Tried to provide consistency with GSM dissector (protocol) names, even if the filenames now don't match the dissector name. svn path=/trunk/; revision=44162
2012-07-22Update display filter names per Bug 2794. Part 1 of many.Michael Mann1-1/+1
svn path=/trunk/; revision=43907
2012-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538
2012-03-18From Reinhard Speyerer: Fix several misspellings/typos in WiresharkBill Meier1-1/+1
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6967 svn path=/trunk/; revision=41645
2012-03-16Use NULL instead of essentially duplicate text for one hf[] blurb;Bill Meier1-454/+451
Do some reformatting and do indentation & whitespace cleanup. svn path=/trunk/; revision=41614
2012-03-11Remove extraneous parentheses around some comparisons to silence a warning.Stig Bjørlykke1-4/+4
svn path=/trunk/; revision=41480
2012-01-26From Mike Morrin:Anders Broman1-0/+585
Add dissectors for GSM and UMTS Cell Broadcast protocols. ( - the patch for gsmtap ) https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6770 svn path=/trunk/; revision=40735