Wireshark-commits: [Wireshark-commits] master 48a6683: Use wtap_read_bytes() to skip over bytes whe

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Wed, 28 Sep 2016 23:46:21 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=48a66835ee4f319ba7806a542bb2cf1f16a2ac06
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

48a6683 by Guy Harris (guy@xxxxxxxxxxxx):

    Use wtap_read_bytes() to skip over bytes when reading a record.
    
    Allow file_read() to take a null pointer as a buffer argument; a null
    argument means "do everything except copy the bytes from the file to the
    user buffer".  That means that wtap_read_bytes() and
    wtap_read_bytes_or_eof() also support a null pointer as a buffer
    argument.
    
    Use wtap_read_bytes() with a null buffer argument rather than
    file_skip() to skip forward over data.
    
    This fixes some places where files were mis-identified as ERF files, as
    the ERF open heuristics now get a short "read" error if they try to skip
    over more bytes than exist in the file.
    
    Change-Id: I4f73499d877c1f582e2bcf9b045034880cb09622
    Reviewed-on: https://code.wireshark.org/review/17974
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  a3ce233   PROFINET: Fix possibly passing a null pointer to function
    adds  48a6683   Use wtap_read_bytes() to skip over bytes when reading a record.


Summary of changes:
 wiretap/capsa.c         |   19 ++++++++++---------
 wiretap/erf.c           |   22 +++++++++++-----------
 wiretap/file_wrappers.c |   34 +++++++++++-----------------------
 wiretap/file_wrappers.h |    1 -
 wiretap/iptrace.c       |    4 ++--
 wiretap/k12.c           |    4 ++--
 wiretap/libpcap.c       |    2 +-
 wiretap/mpeg.c          |    5 +++--
 wiretap/nettl.c         |    2 +-
 wiretap/ngsniffer.c     |   24 +++++++++++-------------
 wiretap/pcapng.c        |   14 +++++++-------
 wiretap/peekclassic.c   |    5 +++--
 wiretap/peektagged.c    |    2 +-
 wiretap/snoop.c         |    2 +-
 wiretap/vwr.c           |    2 +-
 wiretap/wtap-int.h      |    6 ++++--
 wiretap/wtap.c          |    6 ++++--
 17 files changed, 73 insertions(+), 81 deletions(-)