aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-wap.c
AgeCommit message (Collapse)AuthorFilesLines
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>
2018-06-03Fix handling of guintvars.Guy Harris1-7/+7
1) A value that fits in a 32-bit unsigned integer may take more than 4 octets - the uppermost bit of the octet is a "more octets follows" flag, so 4 octets contain only 7*4 - 28 bits of value, so a fifth octet preceding that with the upper 3 bits zero could result in a value that fits in 32 bits, and further octets of 0x80 just add further leading zeroes. We should, instead, check for *overflow*, meaning that if we add more bits at the bottom, the result is *less* than the previous value. 2) When the result overflows, we should clamp it a UINT_MAX, rather than setting it to zero, and should keep accumulating octets, so that we return the correct octet count. That prevents infinite loops where the item's length, and the item itself, are considered zero-length. This should fix bug 14738. Bug: 14738 Change-Id: I1d1b60e22f169959c1573b1fcb7e010e027b5132 Reviewed-on: https://code.wireshark.org/review/27986 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-04clean up tvb_get_guintvar() a bit moreMartin Kaiser1-21/+26
Wrap long lines. Use a do-while loop. We know up-front that we'll go into the loop at least once. Remove the cont variable, use the exit condition directly. Set *octetCount = 0 if we return 0 because of an error. In that case, we did not process any bytes and should inform the caller about this. Change-Id: I222270939e42e0096b6f5a25b197bd4bae12235e Reviewed-on: https://code.wireshark.org/review/26245 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-04wap: include stdio.hMartin Kaiser1-0/+2
Otherwise, fprintf() is not defined and the debug prints don't work. Change-Id: I9bc791dfc829cf9e7b1b6e61b0090d2fb94bebb2 Reviewed-on: https://code.wireshark.org/review/26244 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-04tvb_get_guintvar: correct a debug printMartin Kaiser1-9/+2
We always start with counter=0, guint *octetCount is used only as a return value. Change-Id: I3c080c59ef7620c5007f6dc3139a78a72cff2a21 Reviewed-on: https://code.wireshark.org/review/26243 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-04tvb_get_guintvar: don't overflow our return valueMartin Kaiser1-1/+1
tvb_get_guintvar() returns a guint. If we haven't seen the final byte after sizeof(guint) bytes, something is wrong. Abort and return 0. This is the minimum fix for Bug: 14473 Change-Id: Ibe8a1239c1cbbeec0591c66710416bb56f9f60dc Reviewed-on: https://code.wireshark.org/review/26242 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot 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>
2016-07-26WAP: check that tvb_get_guintvar does not overflowPascal Quantin1-1/+5
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-367/+0
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-08Handle the encoding when displaying the string table.Guy Harris1-0/+99
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>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-1/+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-09-29Add editor modelines and adjust indentation as needed.Bill Meier1-0/+13
Change-Id: I857700d685354b0bc9e0ca647c57faba981b520f Reviewed-on: https://code.wireshark.org/review/4373 Reviewed-by: Bill Meier <wmeier@newsguy.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>
2012-12-10Re-generate value_string array for MIBenum mapping char set names from ↵Bill Meier1-267/+294
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-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2010-11-03Use value_string_ext fcns to access certain value_string arrays;Bill Meier1-1/+2
Some whitespace cleanup. svn path=/trunk/; revision=34763
2006-05-21change a whole bunch of ethereal into wiresharkRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18196
2004-07-18Move dissectors to epan/dissectors directory.Gilbert Ramirez1-0/+327
Also move ncp222.py, x11-fields, process-x11-fields.pl, make-reg-dotc, and make-reg-dotc.py. Adjust #include lines in files that include packet-*.h files. svn path=/trunk/; revision=11410