aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
AgeCommit message (Collapse)AuthorFilesLines
2019-07-26HTTPS (almost) everywhere.Guy Harris72-74/+74
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-25USBLL: Initial USB 2.0 Link Layer dissectorTomasz Moń3-0/+6
Dissect raw USB Packets. The actual USB packets to transaction conversion (which is needed to pass the data to existing USB URB dissector) is not implemented yet. Ping-Bug: 15908 Change-Id: Ia75d58882d770fdd8650622d318241743069ad8f Reviewed-on: https://code.wireshark.org/review/34006 Reviewed-by: Tomasz Moń <desowin@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-21Remove ABI compliance checker code.João Valverde1-14/+0
It's broken, unmaintained, poorly implemented and obsoleted by saner debug-info methods. Note: To do the compliance check properly would require much more extensive work to clearly define public and private interfaces (without manual bookeeping of files or symbols either, of course, because who would want that...). Change-Id: Ib801f3c152ca2369f95ca1f4af4d37cd8cc7c47a Reviewed-on: https://code.wireshark.org/review/33928 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt>
2019-07-20wiretap: candump: Don't generate a temporary PCAP fileMaksim Salau4-248/+149
It's preferable to parse text files and generate packets on demand, rather than generate a temporary PCAP file and dump all available packets into it. Parsing on the fly has a benefit of handling damaged files up to the point of damage, while the approach with a temporary file doesn't allow either to report that the original file is damaged or perform conversion in the first place. This version works faster than the previous one. Command: time ./run/tshark -r ./candump-2019-07-01_111120.log.gz > /dev/null The test file is attached to the bug 15889 The current version: real 0m0,597s user 0m0,533s sys 0m0,118s The previous version: real 0m2,176s user 0m1,966s sys 0m0,100s Bug: 15889 Change-Id: I862ce47752531c2e9d9459f5d865c1fc08f32fea Reviewed-on: https://code.wireshark.org/review/34007 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-12wiretap: do not pollute debug builds with candump debug messagesPascal Quantin3-5/+33
Change-Id: I2f7c4c3d23d5be27c1fac704272b9e581a4de0f7 Reviewed-on: https://code.wireshark.org/review/33912 Petri-Dish: Pascal Quantin <pascal@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2019-07-11wiretap: candump: Reset error info and fix scanner warningsMaksim Salau2-0/+28
candump_open() may be called with non-empty error code and string. The error code is not reset upon success in run_candump_parser() which may mislead the caller function thus affecting opening the file. yy_fatal_error(), yy_alloc(), yy_realloc() and yy_free() make no use of the yyscanner argument, which results in warnings on OSX. In order to get rid of those warning we provide our own implementations of memory allocation functions and hack YY_EXIT_FAILURE macro in order to pretend using the argument. Change-Id: I672d374b26970b2699b9d789b6118e97ba660bdf Reviewed-on: https://code.wireshark.org/review/33892 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-07-11Candump_parser: fix implicit declaration warningUli Heilmeier1-0/+1
Include string.h to fix implicitly declaring library function 'memcpy' with type 'void *(void *, const void *, unsigned long)' Change-Id: Ia6796f1966db606f946e0935ed0e5b70702c88c9 Reviewed-on: https://code.wireshark.org/review/33891 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-11wiretap: Add support of candump logsMaksim Salau7-0/+889
The change adds ability to import text logs produced by the candump tool. E.g.: candump -L can0 -or- candump -l can0 The whole file is read and converted into a temporary PCAPNG file with Exported PDU packets containing SocketCAN frames. Bug: 15889 Change-Id: I5ad93dca96d6e955a4b21cf624f0553e60f060f6 Reviewed-on: https://code.wireshark.org/review/33800 Petri-Dish: Jim Young <jim.young.ws@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-08wiretap: Add a phone log reader.Anders Broman6-2/+931
Change-Id: I0b290df4783616f1eb15e6ad35fbd6d2b4c3dbdd Reviewed-on: https://code.wireshark.org/review/33865 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-01Pass the correct value to ascendlex_destroy().Guy Harris1-1/+1
It takes a yyscan_t as an argument, not a pointer to a yyscan_t; a yyscan_t is a pointer to the scanner state. (A pointer to it is passed to the init routine so that it can be set to point to the allocated state, not because it's a structure itself.) Change-Id: If80ca1caaa07d8a966df8d07f989b722869ac58b Reviewed-on: https://code.wireshark.org/review/33814 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-01wiretap: ascend: Destroy lexer state after parsingMaksim Salau1-0/+2
Lexer private structure is initialized but never destroyed or reused. Change-Id: I61d43b4cb14a2d3b3706267eb393e4562adb00f9 Reviewed-on: https://code.wireshark.org/review/33809 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-06-19Fix error message for an unknown pcapng version number.Guy Harris1-1/+1
We were using fields in the pcapng_t that weren't set yet to report the version number in question; use the variables we were checking. Change-Id: Ib03bafe62d8c7b1aa54b2ef22640e3b00722142a Ping-Bug: 15862 Reviewed-on: https://code.wireshark.org/review/33671 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-06-17Add support for embedding WireGuard keys in a pcapng filePeter Wu1-0/+1
pcapng spec update is here: https://github.com/pcapng/pcapng/pull/62 Bug: 15571 Change-Id: I2f1921b1da70ac0bab8c38dd5138a9dfe7843fea Reviewed-on: https://code.wireshark.org/review/33300 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-05-20wtap: Add support for 802.11ah and 802.11ax PHYs.Richard Sharpe1-0/+2
There may need to be more of these. Bug: 15740 Change-Id: I5d3a97ed50d66dfcb85df0ab7053e8a44c531134 Reviewed-on: https://code.wireshark.org/review/33280 Petri-Dish: Richard Sharpe <realrichardsharpe@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-05-20pcapng: fix the magic when bytes are swapped.Dario Lombardo1-1/+1
This value is used when checking if the file was generated on a machine with different endianess. The error message changes from "Unrecognized pcapng format or not pcapng data." to "dumpcap: Interface 0 is big endian but we're little endian." Fix dumpcap.c and pcapio.c. Ping-Bug: 15754 Change-Id: I3a31f873f01bcb3f1324410e70f29f285e56c715 Reviewed-on: https://code.wireshark.org/review/33274 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-05-173gpp_32_423: Fix dissection of changeTime.Anders Broman1-13/+15
Change-Id: I8d86f92a918044763a02d0ba9856ea97c3937bf1 Reviewed-on: https://code.wireshark.org/review/33240 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-05-16In pcapng_open(), don't use the local pcapng_t once we know it's a pcapng file.Guy Harris1-1/+1
Use the local one *only* while we're trying to determine whether we have a pcapng file or not; once we know we have a pcapng file, and have allocated a pcapng_t and attached it to the wtap structure, pass *that* one to pcapng_read_block(), so if it changes anything in the pcapng_t, it changes the one we're using. Change-Id: I53b32595276be97957a0b6056171471878fa40c4 Reviewed-on: https://code.wireshark.org/review/33226 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-16wtap: remove unneeded check (CID: 1441486).Dario Lombardo1-1/+1
wth has been already checked in line 315. Change-Id: Ib620e0b1e9262e5344feb934b024f7817cfda6fd Reviewed-on: https://code.wireshark.org/review/33178 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-05-16Keep and use per-interface, not per-file, FCS length information.Guy Harris1-6/+11
There is no FCS length information for a pcapng file; there's FCS length information for each interface. Change-Id: I3abb1a35b28475aa3ad6f126060140d0a524bbca Reviewed-on: https://code.wireshark.org/review/33215 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-10Fill in the packet flags for *Peek classic and tagged files.Guy Harris2-10/+29
Change-Id: I0f075c5bc7bb177a23be11e23e3701a7412a6e3d Reviewed-on: https://code.wireshark.org/review/33153 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-09Set packet flags for some link layers.Guy Harris1-7/+44
Change-Id: Ia46a639b241dcbd983205ee0118c51abf5604a15 Reviewed-on: https://code.wireshark.org/review/33124 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-04-061514 is a better initial Buffer size than 1500.Guy Harris1-1/+1
Ethernet packets without the CRC are 1514 bytes long, not 1500 bytes long; using 1514 bytes will avoid a reallocation for a full-sized Ethernet packet. Change-Id: Ie8da3f13bf3df07e23e4478b7dcf84f06dec6a9d Reviewed-on: https://code.wireshark.org/review/32761 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-04-05Have wtap_read() fill in a wtap_rec and Buffer.Guy Harris57-453/+417
That makes it - and the routines that implement it - work more like the seek-read routine. Change-Id: I0cace2d0e4c9ebfc21ac98fd1af1ec70f60a240d Reviewed-on: https://code.wireshark.org/review/32727 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-04-04iseries: ensure the buffer is null terminated.Dario Lombardo2-2/+9
Check buflen to prevent wrong scanf call as well. Bug: 15614 Change-Id: I58a2855d8b1beda067bf9b2d724229ab20249228 Reviewed-on: https://code.wireshark.org/review/32573 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2019-03-24iseries: fix wrong indentation.Dario Lombardo1-32/+32
Change-Id: I4d6e145412037e4a3a40688139b12ada0f36e413 Reviewed-on: https://code.wireshark.org/review/32556 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com>
2019-03-24Revert "iseries: stop scanning a unicode string when the null terminator is ↵Guy Harris1-1/+1
hit." This reverts commit c599e490281b523df23010ae25307ff002068e17. Reason for revert: This completely fails to recognize Unicode iSeries dumps. Change-Id: Ie31141879b1bc3608a5dfdcba6887bb6f0018a47 Reviewed-on: https://code.wireshark.org/review/32568 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-24iseries: stop scanning a unicode string when the null terminator is hit.Dario Lombardo1-1/+1
Bug: 15614 Change-Id: I1df4992dcd10e7d9a66fc88a0269b70fc065b079 Reviewed-on: https://code.wireshark.org/review/32514 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com>
2019-03-23Clean up IPMB/I2C link-layer header types.Guy Harris3-35/+36
209 is LINKTYPE_IPMB_LINUX; add _LINUX/_linux to the WTAP_ENCAP_ name and function/structure names, to clarify that it's not I2C in general, it's I2C with a particular pseudo-header. 199 is now LINKTYPE_IPMB_KONTRON, not LINKTYPE_IPMB, as it doesn't have raw I2C packets, it has I2C packets with a pseudo-header. Change the WTAP_ENCAP_ name, and add a dissector for it. Change-Id: Ie097f4317b03d2b2adfd9b81a4b11caf6268399e Reviewed-on: https://code.wireshark.org/review/32539 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-17Treat erf_timestamp_t's as integral values.Guy Harris1-2/+2
That's what they are, and that's how other code in erf_open() treats them; just use assignment to initialize prevts and to set prevts to ts. Maybe this will keep the Clang static analyzer from calling prevts a garbage value when compared with ts. Change-Id: I2ee2376ced5c3efa6beab34276009a3177c94416 Reviewed-on: https://code.wireshark.org/review/32455 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-16Remove incorrectly-inserted "return FALSE;".Guy Harris1-1/+0
That made PACKET_DESCRIBE() do nothing, causing warnings from the Clang Static Humiliator. Change-Id: I6f433cd193b6398d89038e95c7bf5deb24aa186d Reviewed-on: https://code.wireshark.org/review/32437 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-16Fix up the checks in nspm_signature_version().Guy Harris1-36/+93
Move the read out of nspm_signature_version(), to make it a bit clearer what file I/O we do in the open process; have nspm_signature_version() just look for a signature in a single page. In the loop in nspm_signature_version(), make sure we have enough of the record header to look at the type and length fields in that header before looking at them and, when we can look at them, make sure the length of the record 1) fits in what remains of the page we're looking at and 2) is big enough to be the length of a signature record. Change-Id: I7d625859136e6f39c40b166067fc7efea806d9b0 Reviewed-on: https://code.wireshark.org/review/32426 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-15netscaler: add more sanity checks.Dario Lombardo1-0/+4
Fix more crashes found in the provided bug report. Bug: 15497 Change-Id: If84498fa879ad56c8677f8c1442a8dc0e5906003 Reviewed-on: https://code.wireshark.org/review/32333 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-14Ask, in a comment, whether we should do an exact match on signatures.Guy Harris1-0/+2
Change-Id: I3c6e904a2e8cc843687b69f633fd0dfbf0ec7937 Reviewed-on: https://code.wireshark.org/review/32407 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-14Fix the test for a NetScaler trace file.Guy Harris1-7/+21
When testing the signature field against a given version's signature: we require that the signature field's size (size, not C null-terminated string length) be at least the size of the signature string (otherwise, it can't possibly match); we check to make sure that the first N bytes of the signature field, where N is the size of the version's signature string (not including any terminating '\0' in that string), match the version's signature string. I.e., we require that the version's signature string is a prefix of the signature string in the file. This does not require that the signature string in the file be null-terminated. It also doesn't allow the file's signature string to be a substring of the version's signature string, as that's *NOT* sufficient to identify the file as a NetScaler trace file, especially if we forcibly null-terminate the file's signature string and we trucate it to be zero-length, as, in that case, it's *always* a prefix of the version's signature string, and the file is incorrectly identified as a NetScaler trace file. (While we're at it, we make the nspm_signature_isvXXX() routines return true if it *is* and false if it *isn't*, rather than the reverse; having a routine with a name containing "is", and not "isnt", return true if it *isn't* is confusing.) Change-Id: I3694773a71b8b63d280e42f146698c82a0f0c332 Ping-Bug: 15601 Reviewed-on: https://code.wireshark.org/review/32403 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-10Ask in a comment whether we should test HAVE_STRUCT_STAT_ST_BLKSIZE.Guy Harris1-1/+19
We're defining it now based on whether there's an st_blksize member of struct stat. We're currently testing _STATBUF_ST_BLKSIZE, but that's not guaranteed to be defined on platforms that have an st_blksize member of struct stat (it's not defined on macOS, for example). Change-Id: I4e6011a7668da94cf1ca6328e29c50924dd1d8b0 Reviewed-on: https://code.wireshark.org/review/32381 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-03Discard the upper bits of the "network" field in the file header.Guy Harris1-1/+44
Libpcap's done that for a while; we should do so as well. (Ideally, we should use those bits, but there's an issue with pcapng, where the FCS length in the IDB is described as being in units of bits, but where we're treating it as being in units of bytes, that I'd like to resolve first.) Change-Id: Ibcb82f1dcaa8baae5bba55636cea8852a6af814e Reviewed-on: https://code.wireshark.org/review/32303 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-03Say what short name already exists, to help the developer somewhat.Guy Harris1-1/+1
That tells then what name they *can't* use for their file-type plugin, because it's already a built-in file type name in Wireshark. Change-Id: Ibbbfda21e1109cf46275008a46b8ea65c8fcf4b5 Reviewed-on: https://code.wireshark.org/review/32291 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-02vwr: fix Uninitialized argument value found by Clang (Analyzer)Alexis La Goutte1-2/+2
Change-Id: Ic4b5c2d34eafccaa115256e8d3e0a5518621ba76 Reviewed-on: https://code.wireshark.org/review/32288 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-28Add IEEE 802.15.4 TAP link typeJames Ko3-0/+6
New link type for IEEE 802.15.4 with pseudo-header and optional meta-data TLVs, PHY payload exactly as it appears in the spec (no padding, no nothing), and FCS if specified by FCS Type TLV. Specification at https://github.com/jkcko/ieee802.15.4-tap Bug: 15429 Change-Id: I67bd154891ad5818be9a1630aa5cbb863b55509a Reviewed-on: https://code.wireshark.org/review/32141 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-26netscaler: fix multiple out-of-bounds reads.Dario Lombardo1-6/+60
Multiple bugs have been found in the provided bug. Some of them have been fixed in gefe920a, others here. The main problem is when malformed files give wrong lenghts to the code, that casts and dereference it without checking, causing oob reads. The fix introduces a check function that prevents to go beyond the limits, early returning with a malformed file message. Other bugs have been fixed by forcing the string terminator that allows the use of strlen() and MIN() that prevent wrong reads. Bug: 15497 Change-Id: I8411208b5ea0f1a0720a17b882f704d03296d1c4 Reviewed-on: https://code.wireshark.org/review/32194 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-21vcwr: fix Uninitialized argument value found by Clang (Analyzer)Alexis La Goutte1-2/+2
Change-Id: Id0b1f4815e66fa5ef6b120099546a3d018164c99 Reviewed-on: https://code.wireshark.org/review/32134 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-20netscaler: fix crash when reading malformed packets.Dario Lombardo1-0/+6
When reading a malformed packet, it can occur that we go close to the end of the buffer. We need to check if we have 2 bytes before reading a uint16. Bug: 15497 Change-Id: I2b00f44933ca11b925ffbf05b9855684feebcda5 Reviewed-on: https://code.wireshark.org/review/32028 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-19Add --discard-all-secrets to remove decryption secrets.Guy Harris3-0/+41
Bug: 15435 Change-Id: I78503c9c31ab3eda39908b91dca3ef3fb9af34bf Reviewed-on: https://code.wireshark.org/review/32100 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-13Add macros for the pack_flags field.Guy Harris2-3/+74
Add macros to extract the direction, reception type, and FCS length fields of the pack_flags field, and add definitions for different directions and reception types. Add a macro to construct a pack_flags field value from subfields; this is for use by non-pcapng file readers (the pack_flags field is just a copy of the EPB flags option, so that's not needed for pcapng). Move some #defines for that field from packet-frame.c to wtap.h, and rename them to match the new macros. Use the macros rather than rolling our own code. Fix a variable name in text2pcap.c that apparently had the wrong name, given the value that was being tested. Change-Id: Ia788ca4e9f5fabd8d24e6ead5ff1817509f54827 Reviewed-on: https://code.wireshark.org/review/32010 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-10logcat-text: set G_REGEX_RAW to fix potential crashesPeter Wu1-9/+9
No UTF-8 patterns are in use. To avoid potential crashes on invalid input, treat all lines as binary data in the dissector to match wiretap. Change-Id: I10735c2246536fb4b2fdb9236cdbf7917d2e816c Ping-Bug: 14905 Reviewed-on: https://code.wireshark.org/review/31938 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-02-02CMake: Fix DOCDIR on UnixJoão Valverde1-1/+1
User guides are installed to doc/Wireshark. Use doc/wireshark instead. Remove leftover variable CPACK_PACKAGE_NAME. Change-Id: I9a1d6bdc7d8f0b48c61e43679285d5ba83904a63 Reviewed-on: https://code.wireshark.org/review/31851 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2019-01-31Also check whether we have nothing but DLCI bytes.Guy Harris1-4/+8
The two failure modes are 1) no byte has the low-order bit set, so we didn't even find the end of the DLCI or 2) the byte at the end of the packet has the low-order bit set, so that it's all DLCI with no control byte after it. Expand a comment. Bug: 15463 Change-Id: Ib76686391213dd56c06d665aa87a188621fe6816 Reviewed-on: https://code.wireshark.org/review/31828 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-31Check whether you've hit the end of the packet data before going further.Guy Harris1-2/+3
If we found no bytes with the low-order bit set in the packet data, there's no point in checking the non-existent "next" byte to see if it's a HDLC-style UI control byte (0x03). Bug: 15463 Change-Id: Ibfd186e5b81d8ce229362e23f00b31a27900831a Reviewed-on: https://code.wireshark.org/review/31824 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-30ngsniffer: fix comment.Dario Lombardo1-2/+2
Change-Id: Ia25ce4841ee3831f995d1fa7cd2cb8a850f1c01e Reviewed-on: https://code.wireshark.org/review/31818 Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-25wiretap: fix memleaks with wtap_rec::opt_commentPeter Wu4-2/+11
The memory ownership of wtap_rec::opt_comment was not clear. Users of wtap were leaking memory (editcap.c). wtap readers were not sure about freeing old comments (erf) or simply ignored memleaks (pcapng). To fix this, ensure opt_comment is owned by wtap_rec and free it with wtap_rec_cleanup. The erf issue was already addressed since cf_get_packet_comment properly duplicates wth.opt_comment memory. - wtap file formats (readers): - Should allocate memory for new comments. - Should free a comment from an earlier read before writing a new one. - Users of wth: - Can only assume that opt_comment remains valid until the next read. - Can assume that wtap_dump does not modify the comment. - For random access (wtap_seek_read): should call wtap_rec_cleanup to free the comment. The test_tshark_z_expert_comment and test_text2pcap_sip_pcapng tests now pass when built with ASAN. This change was created by carefully looking at all users opt "opt_comment" and cf_get_packet_comment. Thanks to Vasil Velichkov for an initial patch which helped validating this version. Bug: 7515 Change-Id: If3152d1391e7e0d9860f04f3bc2ec41a1f6cc54b Reviewed-on: https://code.wireshark.org/review/31713 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Vasil Velichkov <vvvelichkov@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>