aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-wbxml.c
AgeCommit message (Collapse)AuthorFilesLines
2018-05-16wbxml: fix issue found by PVS Studio (V1001)Alexis La Goutte1-1/+1
The 'len' variable is assigned but is not used until the end of the function Change-Id: I98f0cc298e503412e0bdf8919a4a7be8ef45a2f9 Reviewed-on: https://code.wireshark.org/review/27506 Reviewed-by: Anders Broman <a.broman58@gmail.com>
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>
2017-06-14WBXML: Fix some more potential infinite loops.Michael Mann1-5/+11
tvb_get_guintvar can generate some unrealistic values so do some sanity checking on them. Bug: 13796 Change-Id: I2d5f7a48c2e982a419ea6ab3ac0000be3b6bcbc7 Reviewed-on: https://code.wireshark.org/review/22121 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>
2017-04-04wbxml: don't THROW() an exception from a dissectorMartin Kaiser1-19/+8
If the offset is out of bounds, we can simply continue and proto_tree_add_...() will throw an exception for us. While at it, wrap some long lines and remove obsolete coments about g_malloc()ed memory (the dissector has been converted to wmem). Change-Id: Icd36418f07c0cf33c5fe906a8a2d3160789ee1f2 Reviewed-on: https://code.wireshark.org/review/20856 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-04-01Don't add an FT_UINT32 with proto_tree_add_none_format().Guy Harris1-1/+1
Make it an FT_NONE. Change-Id: I83339d84b88c7decffa6e6a48d12acc4b063a4ad Reviewed-on: https://code.wireshark.org/review/20822 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-12packet-wbxml.c: Fix potential infinite loopsMichael Mann1-25/+55
Bug: 13477 Change-Id: Ib6c440bbcbb5011e8f23fb87418acd87bb38c272 Reviewed-on: https://code.wireshark.org/review/20513 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-31format_text_wmem -> format_textMichael Mann1-1/+1
All cases of the "original" format_text have been handled to add the proper wmem allocator scope. Remove the "original" format_text and replace it with one that has a wmem allocator as a parameter. Change-Id: I278b93bcb4a17ff396413b75cd332f5fc2666719 Reviewed-on: https://code.wireshark.org/review/19884 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-31Add format_text_wmem.Michael Mann1-1/+1
This allows for a wmem_allocator for users of format_text who want it (dissectors for wmem_packet_scope()). This lessens the role of current format_text functionality in hopes that it will eventually be replaced. Change-Id: I970557a65e32aa79634a3fcc654ab641b871178e Reviewed-on: https://code.wireshark.org/review/19855 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-31Dissectors don't need a journey of self discovery.Michael Mann1-2/+2
They already know who they are when they register themselves. Saving the handle then to avoid finding it later. Not sure if this will increase unnecessary register_dissector functions (instead of using create_dissector_handle in proto_reg_handoff function) when other dissectors copy/paste, but it should make startup time a few microseconds better. Change-Id: I3839be791b32b84887ac51a6a65fb5733e9f1f43 Reviewed-on: https://code.wireshark.org/review/19481 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-08-18xbxml: restore removed line.Dario Lombardo1-1/+2
This makes CID 1317251 obsolete. Change-Id: Id342b996268ac0734a52e93c02ae368960ee2294 Reviewed-on: https://code.wireshark.org/review/17027 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-26WBXML: limit the recursion levelPascal Quantin1-1/+7
Bug: 12663 Change-Id: Ibbab2f20f4eda9f42ea0ea5e88dcf553cce1b55c Reviewed-on: https://code.wireshark.org/review/16670 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-07-26WAP: check that tvb_get_guintvar does not overflowPascal Quantin1-65/+67
Bug: 12661 Change-Id: I2ef857d6be6595fd89f3dbb8d41c1c70d550ad93 Reviewed-on: https://code.wireshark.org/review/16665 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-05-08Remove the MIBenum stuff from the WAP code.Guy Harris1-3/+4
MIBenum values are from an IANA registry, not a WAP specification; add <epan/iana_charsets.h> to declare the MIBenum -> Wireshark encoding mapper routine and the value_string_ext for MIBenum values, and epan/iana_charsets.c to define them. Change-Id: I6d9c82cd011bd5211c688322e6423de38e161f41 Reviewed-on: https://code.wireshark.org/review/15298 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-08Show MIBenum values for character sets as decimal.Guy Harris1-1/+1
http://www.iana.org/assignments/character-sets/character-sets.xhtml is the official IANA registry for character sets, including MIBenum values, and it shows MIBenum values in decimal, not hex, so show them in decimal, not hex. Change-Id: Id00a0d351a1f758401232aba621cc60aeccf360a Reviewed-on: https://code.wireshark.org/review/15292 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-08Handle the encoding when displaying the string table.Guy Harris1-18/+21
Don't just treate the strings as piles of ASCII characters. Add a proto_tree_add_item_ret_string_and_length() routine to help do this. Clean up some of the documentation of the proto_tree_add_item_ret routines while we're at it. Change-Id: Ib4c52bd8a8331eac97312583326f5be9175889d9 Reviewed-on: https://code.wireshark.org/review/15291 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-08The tabulation is specified by the stuff at the end.Guy Harris1-2/+0
I'm not sure what "4-space tabulation means", but: if it's "a tab character means 4 spaces", that's just *wrong* in a UN*X environment (Apple's mistaken use of "tab is 4 spaces" as the default in Xcode nonwithstanding - Xcode is just *wrong* there); if it's "use 4-space *indentation*", then the code should be reformatted and the editor hints updated. Change-Id: Ie8249b483fe9d6fcd8db29b72167eb854eec863e Reviewed-on: https://code.wireshark.org/review/15288 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-08Show the string table a bit better.Guy Harris1-21/+41
Show, for each item, the offset and the string value; the offset is what's used in tokens. While we're at it, print a 32-bit unsigned length field as unsigned rather than signed. Change-Id: I167e1683bab6a8ed1dba4c53c1c9050d5c25c754 Reviewed-on: https://code.wireshark.org/review/15286 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-1/+1
That removes most of the uses of the frame number field in the frame_data structure. Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22 Reviewed-on: https://code.wireshark.org/review/13509 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-31Don't cast away constness.Guy Harris1-33/+33
Change-Id: I6b5a6099cd90f2e148625c1a1eb3fb36262e8c39 Reviewed-on: https://code.wireshark.org/review/12972 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-2/+2
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-6/+8
Picking off "easy" dissectors that only have one or two exit points at most. This concludes a "first pass" over the dissector directory. Change-Id: If5ce5484214be50fe541cba478da1de62e354297 Reviewed-on: https://code.wireshark.org/review/11830 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-08-10Eliminate proto_tree_add_text from packet-wbxml.cMichael Mann1-1236/+756
While I was at it, some (mostly) duplicate functionality allowed rearranging of functions to eliminate most forward declarations. Change-Id: I2d7027d336c391d81dfe81c7a1ebf0d56c0826b2 Reviewed-on: https://code.wireshark.org/review/9951 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>
2014-12-25Deleting unnecessary #includes from dissectors.Martin Mathieson1-1/+0
Fifth batch (packet-rtp.c -> end). Will look at cleaning up and committing script afterwards. Change-Id: I8ed61dc941d98d3f7259a9d1f74e214eb7b4bfa2 Reviewed-on: https://code.wireshark.org/review/6052 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-4/+0
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06Adjust indentation to match editor modelines; Do other minor whitespace changes.Bill Meier1-1/+1
Change-Id: Ic020b2c92db5d14a2be9dc4d35aef4514b8b0353 Reviewed-on: https://code.wireshark.org/review/4502 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-06convert to proto_tree_add_subtree[_format]Michael Mann1-3/+2
Change-Id: I3efa2a81ab2685cde6eae0a00b24520478a545ce Reviewed-on: https://code.wireshark.org/review/2900 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>
2013-12-15Fix [-Wmissing-prototypes]Jakub Zawadzki1-3/+2
svn path=/trunk/; revision=54135
2013-12-14Fix const warnings.Jakub Zawadzki1-2/+2
svn path=/trunk/; revision=54092
2013-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53230
2013-09-12emem -> wmemJörg Mayer1-41/+41
"tshark -v" tested svn path=/trunk/; revision=51988
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-4/+2
svn path=/trunk/; revision=49923
2013-03-29Rename value string (and similar) functions to use a consistent pattern. ThisEvan Huus1-1/+1
was done using textual search+replace, not anything syntax-aware, so presumably it got most comments as well (except where there were typos). Use a consistent coding style, and make proper use of the WS_DLL_* defines. Group the functions appropriately in the header. I ended up getting rid of most of the explanatory comments since many of them duplicated what was in the value_string.c file (and were out of sync with the recent updates I made to those in r48633). Presumably most of the comments should be in the .h file not the .c file, but there's enough churn ahead that it's not worth fixing yet. Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467 svn path=/trunk/; revision=48634
2013-02-01Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+1
svn path=/trunk/; revision=47426
2012-12-10Re-generate value_string array for MIBenum mapping char set names from ↵Bill Meier1-74/+74
latest IANA document; Adds new values and fixes an incorrect value in the previous value_string array. Note: names used as specified (with capitalization) in the document. (Previously all the names in the value_string array were lower case). Also: rename the value_string array to have a less generic name. svn path=/trunk/; revision=46490
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017
2012-08-14convert g_strdup_printf() to ep_strdup_printf()Michael Mann1-43/+39
svn path=/trunk/; revision=44490
2012-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538
2012-06-08From Stefan Hoffmeister:Anders Broman1-234/+523
ActiveSync WBXML CodeSpace updated to match official documentation. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7345 svn path=/trunk/; revision=43151
2012-05-15Remove unneeded #includes (stdlib, stdio, ctypes, time);Bill Meier1-3/+0
In a few cases: do some whitespace, indentation cleanup & reformatting. svn path=/trunk/; revision=42632
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-2/+2
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-10-15Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, ↵Bill Meier1-1/+1
FT_STRINGZ, FT_UINT_STRING as follows: 1. If there's no character encoding (ENC_ASCII, ...) specified then use ENC_ASCII. 2. For all but FT_UINT_STRING, always use ENC_NA (replacing any existing True/1/FALSE/0 /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN). svn path=/trunk/; revision=39426
2011-09-21Fix ex "modeline" so it works;Bill Meier1-1/+1
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5748 svn path=/trunk/; revision=39081
2011-01-16There's no need to pass the result of tvb_get_ptr() as the 'value' inJeff Morriss1-7/+4
proto_tree_add_*(): just use proto_tree_add_item(). Replace some tvb_get_ptr()s with tvb_get_ephemeral_string() or tvb_get_const_stringz(). Use tvb_memeql() & tvb_memcmp(). svn path=/trunk/; revision=35558
2010-11-04Use value_string_ext fcns to access certain value_string arrays;Bill Meier1-1/+2
Sort certain value_string arrays to be in ascending numeric order; Do minor whitespace cleanup and reformatting of long lines. svn path=/trunk/; revision=34780
2010-11-03Use value_string_ext fcns to access certain value_string arrays;Bill Meier1-11/+14
Some whitespace cleanup. svn path=/trunk/; revision=34763
2010-01-26Fix some gcc -Wshadow warningsBill Meier1-48/+48
svn path=/trunk/; revision=31673
2009-11-09Removed an unused assignment.Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=30889
2009-10-25From Jakub Zawadzki:Anders Broman1-4/+2
Cleanup dissector code - use proper memory functions. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164 svn path=/trunk/; revision=30691
2009-08-05Fix for bug 3811:Jaap Keuter1-0/+6
Add missing shorthand application/vnd.ms-sync besides application/vnd.ms-sync.wbxml. svn path=/trunk/; revision=29306