Commit Graph

33 Commits

Author SHA1 Message Date
Martin Kaiser 620f69a74b mp4: limit the recursion depth for boxes
Although the dissection of each box header consumes a couple of bytes,
it turned out that it's still possible to crash wireshark with a sample
file that contains a large number of nested boxes. The stack will fill
up before we reach the end of the data bytes.

Keep track of the recursion depth as we walk through the hierarchy of
boxes. Abort if we reach the (locally defined) upper limit.

Bug: 13777
Change-Id: I0f67245a5c74131f10d0f9d99b39ad31711b9775
Reviewed-on: https://code.wireshark.org/review/26167
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-28 22:33:51 +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 a869ec6f55 Adjust proto_tree_add_[float|double]_format_value calls to use unit string
Several calls to proto_tree_add_[float|double]_xxx could be better served
using BASE_UNIT_STRING with a "unit string" in hf_ field.

Added a few more "common" unit string values to unit_strings.[ch]

Change-Id: Id0da7b579403898d20c2667d6c4abcd59d5a48d4
Reviewed-on: https://code.wireshark.org/review/19241
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-13 22:56:36 +00:00
Joerg Mayer c0e48778b7 Fix some warnings/errors of type
git/epan/dissectors/packet-a21.c:478:25: error: 'item' was marked unused but was used
      [-Werror,-Wused-but-marked-unused]
        proto_item_append_text(item, "%s", val_to_str_const(event_id, a21_event_vals, "Unknown"));
                               ^
Added manual change id because file-jpeg.c forced the use of commit -n

Change-Id: Iffff53d6253758c8454d9583f0a11f317c8390cb
Reviewed-on: https://code.wireshark.org/review/14666
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-03-28 11:43:56 +00:00
Michael Mann 443a7ed259 new_create_dissector_handle -> create_dissector_handle for dissector directory.
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now.

Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f
Reviewed-on: https://code.wireshark.org/review/12484
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:37:36 +00:00
Tyson Key fbd81bfd6f Associate the file-mp4 dissector with the audio/mp4 MIME type
Bug:11338
Change-Id: Ied463ea5ef65bcc657e09c0d5f7983cb4dcd581a
Reviewed-on: https://code.wireshark.org/review/9503
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-05 21:35:54 +00:00
Guy Harris 59b4ab53fc Include <math.h> or <stdlib.h> as necessary to declare functions.
Various floating-point math functions require <math.h>, and abs()
requires <stdlib.h>.

Change-Id: I6831cfdb17eac3ce129b6800f0fe82fbcfef2d28
Reviewed-on: https://code.wireshark.org/review/6002
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-22 21:52:08 +00:00
Martin Mathieson 596669f921 First batch of unincludes. Last attempt...
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9
Reviewed-on: https://code.wireshark.org/review/5997
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-22 21:03:13 +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
Alexis La Goutte 9187456045 MP4: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang > 3.3
Change-Id: I0befc8846b9af43e1563adb369ba4d332775ef76
Reviewed-on: https://code.wireshark.org/review/5778
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-12-15 22:12:26 +00:00
Alexis La Goutte 82e63040b6 MP4: fix Unused entry: epan/dissectors/file-mp4.c, hf_mp4_stsd_entry_cnt
Change-Id: I95f0ab387570c0c56e19990cb9b9063051bb792f
Reviewed-on: https://code.wireshark.org/review/5779
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-12-15 22:05:26 +00:00
Martin Kaiser 0a30f6878d start dissecting the stsz box
Change-Id: Ia8fce9307bae33c44d630af403980d162afd88c2
Reviewed-on: https://code.wireshark.org/review/5597
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-12-03 21:31:01 +00:00
Martin Kaiser 2f39f2e8aa BOX_TYPE_STZ2
Change-Id: I4eadf2b613b7803c81593e517408631f8375ab2c
Reviewed-on: https://code.wireshark.org/review/5596
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-12-03 21:30:36 +00:00
Martin Kaiser ee48194705 start dissecting the mvhd box
Change-Id: I66c1973daa89690f6aaa10891408e93e886875ea
Reviewed-on: https://code.wireshark.org/review/5595
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-12-03 21:30:18 +00:00
Michael Mann 6fad7d19e7 Eliminate proto_tree_add_text from some dissectors.
Some other related cleanup.

Change-Id: I45f54032aa8318858f4ee784945b6f2ed163b6ea
Reviewed-on: https://code.wireshark.org/review/4328
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-27 15:44:53 +00:00
Alexis La Goutte f1dd9bc62a Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I19df790d18e71d45df28dc6e8731cd2e1acb098b
Reviewed-on: https://code.wireshark.org/review/3826
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-25 14:43:15 +00:00
Martin Kaiser cca0fd35fe add the flags to all FullBoxes
Change-Id: I6e0109bc1d1acf200fd0c1a9f8ddd3a3d98f5908
Reviewed-on: https://code.wireshark.org/review/3189
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-24 20:01:47 +00:00
Martin Kaiser 0b15ec8cdc start dissecting the MP4 stsd box
Change-Id: I589a6ced098d1d224e86386f028c92fc0797164e
Reviewed-on: https://code.wireshark.org/review/3188
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-24 20:01:20 +00:00
Martin Kaiser fb9851ea57 dissect the MP4 url box
Change-Id: Ibeaf5ba5d104e7f9bc9291e83923f8675abf0099
Reviewed-on: https://code.wireshark.org/review/3187
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-24 20:00:41 +00:00
Martin Kaiser 7d219fdd7d dissect the MP4 dref box
Change-Id: I342f283bbab3052337e00502769150cf3f4a8800
Reviewed-on: https://code.wireshark.org/review/3186
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-24 20:00:11 +00:00
Martin Kaiser 476f49cd0f dissect the MP4 hdlr box
Change-Id: I467bfae2db7d3a119b58505b43b3d9bb59615ee9
Reviewed-on: https://code.wireshark.org/review/3185
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-24 19:59:34 +00:00
Bill Meier 9ed99d5c4e Strip some trailing whitespace; Fix some indentation; Add editor-modelines as needed.
Change-Id: I943153e28f468070d86535abad7be032e1386118
Reviewed-on: https://code.wireshark.org/review/2994
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-11 03:20:54 +00:00
Michael Mann f5e2b4293d convert to proto_tree_add_subtree[_format]
Change-Id: I358bfaa4e5d40cd01b766f614f8bd0dbaf611dd0
Reviewed-on: https://code.wireshark.org/review/2508
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22 14:34:17 +00:00
Martin Kaiser 254e227266 dissect more components of the track header box
Change-Id: If8d35122ce096f52837bdff1c6599b47456697d5
Reviewed-on: https://code.wireshark.org/review/1858
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-05-29 17:29:41 +00:00
Martin Kaiser 0ec20c3019 brackets around MAKE_TYPE_VAL's definition
Change-Id: I8e080b250b81976898d2950da9e91fb32b719590
Reviewed-on: https://code.wireshark.org/review/756
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-20 19:59:22 +00:00
Martin Kaiser 48f6b800ae (nearly empty) function to dissect the body of a track header box
Change-Id: I17e4bb3968e503b250b9c8d6a7a9bb2abf0f6868
Reviewed-on: https://code.wireshark.org/review/755
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-20 19:59:04 +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
Martin Kaiser 5c825d6a36 mp4 box type is always a 7bit ascii string
svn path=/trunk/; revision=54881
2014-01-21 22:16:05 +00:00
Martin Kaiser fc15329e6a add some more box names
svn path=/trunk/; revision=54507
2013-12-31 13:09:52 +00:00
Anders Broman 5fbfa6c351 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54280
2013-12-20 06:30:13 +00:00
Bill Meier 76d4b43a29 Minor whitespace, formatting & etc changes.
svn path=/trunk/; revision=52588
2013-10-13 18:14:59 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Martin Kaiser 44882c4f14 rename packet-mp4.c to file-mp4.c
svn path=/trunk/; revision=50105
2013-06-21 05:18:45 +00:00