Wireshark-commits: [Wireshark-commits] master-2.6 611d7c8: Catch attempts to write multiple encapsu
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Wed, 14 Nov 2018 03:38:59 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=611d7c8fb24bd4aa57418a0e6262c9c62cdf6870
Submitter: "Guy Harris <guy@xxxxxxxxxxxx>"
Changed: branch: master-2.6
Repository: wireshark

Commits:

611d7c8 by Guy Harris (guy@xxxxxxxxxxxx):

    Catch attempts to write multiple encapsulation types if unsupported.
    
    If, in the process of opening the input file, we determine that it has
    packets of more than one link-layer type, we can catch attempts to write
    that file to a file of a format that doesn't support more than one
    link-layer type at the time we try to open the output file.
    
    If, however, we don't discover that the file has more than one
    link-layer type until we've already created the output file - for
    example, if we have a pcapng file with a new IDB, with a different
    link-layer type from previous IDBs, after packet blocks for the earlier
    interfces - we can't catch that until we try to write the packet.
    
    Currently, that causes the packet's data to be written out as is, so the
    output file claims it's of the file's link-layer type, causing programs
    reading the file to misdissect the packet.
    
    Report WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED on the write attempt
    instead, and have a nicer error message for
    WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED on a write.
    
    Change-Id: Ic41f2e4367cfe5667eb30c88cc6d3bfe422462f6
    Reviewed-on: https://code.wireshark.org/review/30617
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    (cherry picked from commit e563ec80ed619fc78edabee03db9b1d92c59852f)
    Reviewed-on: https://code.wireshark.org/review/30618
    

Actions performed:

    from  1dddeff   MMSE: catch length overflows to avoid infinite loop.
     add  611d7c8   Catch attempts to write multiple encapsulation types if unsupported.


Summary of changes:
 ui/alert_box.c                | 11 +++++++++++
 ui/failure_message.c          | 11 +++++++++++
 wiretap/5views.c              |  9 +++++++++
 wiretap/btsnoop.c             | 19 +++++++++++++++++++
 wiretap/k12.c                 |  9 +++++++++
 wiretap/lanalyzer.c           |  9 +++++++++
 wiretap/libpcap.c             |  9 +++++++++
 wiretap/logcat.c              |  9 +++++++++
 wiretap/logcat_text.c         |  9 +++++++++
 wiretap/network_instruments.c |  9 +++++++++
 wiretap/netxray.c             | 18 ++++++++++++++++++
 wiretap/ngsniffer.c           |  9 +++++++++
 wiretap/snoop.c               |  9 +++++++++
 wiretap/visual.c              |  9 +++++++++
 14 files changed, 149 insertions(+)