Commit Graph

19 Commits

Author SHA1 Message Date
João Valverde 8efad466c4 Tools: Fix fix-encoding-args.pl ASCII string validation
Do not require a useless ENC_NA parameter for string encodings.
FT_STRING and FT_STRINGZ types don't have any ndianness.

Follow-up to 6ec429622c.
2022-02-15 11:38:16 +00:00
John Thacker 71ccbe9f37 bencode: remove pointless recursion
This statement is at the top of the function, calls itself recursively
without changing any state, reaches the max recursion level, and then
travels back up the stack adding expert infos and returning -1, and
then at the end always causes a variable to be set to a known value.

Remove all that, and just set the variable to the value it's going to
have anyway. This speeds things up a lot and prevents adding dozens
of expert infos to dictionaries without otherwise changing the
behavior, which does seem to work.
2021-10-16 07:23:03 +00:00
Evan Huus cdfab0d6e9 tvbuff: convert helper methods to pinfo->pool
A few of them just needed scratch memory, so allocate and free it
manually after doing any exception-raising checks.

A few others were returning memory, and needed conversion to accept a
wmem scope argument.
2021-09-01 03:54:52 +00:00
Peter Lemenkov da2cdf7a39 bencode: Fix for truncated packets
Some applications emits improper bencode packets (w/o terminating 'e' -
they erroneously imply that EOF can be considered as a
end-of-dictionary). Let's not fail while parsing these packets.

Change-Id: Ib650e246c7f56b40ef07227eb0dd175a30e4d3a9
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2021-04-13 16:23:33 +02:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
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-07-26 18:44:40 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
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-02-12 16:49:58 +00:00
Michael Mann d802b5b0ec Add format_text_wmem.
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>
2017-01-31 02:26:35 +00:00
Joerg Mayer 0c471e782f Fix more -Wused-but-marked-unused warnings/errors.
Change-Id: Ieb3e70a23c1a55b7ba60b1b32f159341adfe65b7
Reviewed-on: https://code.wireshark.org/review/14682
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-03-28 19:06:13 +00:00
Michael Mann 31a54708f4 new_register_dissector -> register_dissector for dissector directory.
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-12-09 12:38:06 +00:00
Michael Mann 01f7356f85 register_dissector -> new_register_dissector
Picking off "easy" dissectors that only have one or two exit points at most.

Change-Id: I3d5e576b796556ef070bb36d8b55da0b175dcba8
Reviewed-on: https://code.wireshark.org/review/11805
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-11-13 17:44:24 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
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-12-21 05:46:22 +00:00
Bill Meier 9dc332454a Various minor dissector fixes/changes
- Fix a few minor bugs;
- Remove unneeded #includes;
- Do some whitespace/long_lines formatting changes.

Change-Id: I97239fa20727498604682239cda0e1b87b10f4bc
Reviewed-on: https://code.wireshark.org/review/3434
Petri-Dish: Bill Meier <wmeier@newsguy.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-05 19:07:01 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Michael Mann 3d03216eda packet-bencode: proto_tree_add_text -> somthing filterable
Also, cleanup dissector being called only with tree and a few tvb_new_subset calls.

Change-Id: I1dab1b42ef1a27fc85b05d126f51f1582d7e5c58
Reviewed-on: https://code.wireshark.org/review/1932
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-03 12:39:16 +00:00
AndersBroman c68769765c Fix no previous prototype warnings.
Change-Id: I859597ebc957a58f659800ef63318f94e80feabf
Reviewed-on: https://code.wireshark.org/review/1104
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-14 12:50:31 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(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-03-04 14:27:33 +00:00
Evan Huus 32e4d901fc Two fixes for license headers
- packet-bencode.c had the wrong FSF address
- wslua_int64.c had the license as a footer instead of a header

Change-Id: I71204b36a1034af72874d6fe87929c31c9ff03df
Reviewed-on: https://code.wireshark.org/review/123
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-02-05 21:43:59 +00:00
Jelmer Vernooij 53404776be Split out bencode dissector and use it in the bzr dissector.
Change-Id: I5b2ef173faf7670fad64298d67f2aaf055b8d6d8
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-on: https://code.wireshark.org/review/82
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-02-04 14:24:13 +00:00