Wireshark-commits: [Wireshark-commits] master-1.12 337aebe: Add printf-format annotations, fix garb
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 7 Jul 2014 19:50:28 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=337aebe3a9b4f3cb97630b6760281d6e70bbf2d1
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master-1.12
Repository: wireshark

Commits:

337aebe by Peter Wu (peter@xxxxxxxxxxxxx):

    Add printf-format annotations, fix garbage
    
    The WRETH dissector showed up some garbage in the column display. Upon
    further inspection, it turns out that the format string had a trailing
    percent sign which caused (unsigned)-1 to be returned by
    g_printf_string_upper_bound (in emem_strdup_vprintf). Then ep_alloc is
    called with (unsigned)-1 + 1 = 0 memory, no wonder that garbage shows
    up. ASAN could not even catch this error because EP is in charge of
    this.
    
    So, start adding G_GNUC_PRINTF annotations in each header that uses
    the "fmt" or "format" paramters (grepped + awk). This revealed some
    other errors. The NCP2222 dissector was missing a format string (not
    a security vuln though).
    
    Many dissectors used val_to_str with a constant (but empty) string,
    these have been replaced by val_to_str_const. ASN.1 dissectors
    were regenerated for this.
    
    Minor: the mate plugin used "%X" instead of "%p" for a pointer type.
    
    The ncp2222 dissector and wimax plugin gained modelines.
    
    Change-Id: I7f3f6a3136116f9b251719830a39a7b21646f622
    Reviewed-on: https://code.wireshark.org/review/2881
    Reviewed-by: Evan Huus <eapache@xxxxxxxxx>
    (cherry picked from commit f2b4daf4005d60eef7e34e2e6ebf4fe487d3c255)
    Reviewed-on: https://code.wireshark.org/review/2923
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  6217370   Add a cast to satisfy the buildbots.
    adds  337aebe   Add printf-format annotations, fix garbage


Summary of changes:
 asn1/h450-ros/h450-ros.cnf           |    8 ++++----
 asn1/q932-ros/q932-ros.cnf           |    8 ++++----
 asn1/x509if/x509if.cnf               |    6 +++---
 echld/echld-int.h                    |    2 +-
 echld/echld.h                        |    4 +++-
 epan/dfilter/dfilter-int.h           |    2 +-
 epan/dfilter/grammar.lemon           |    4 ++--
 epan/dfilter/semcheck.c              |   10 +++++-----
 epan/diam_dict.l                     |    2 +-
 epan/dissectors/packet-dis.c         |    2 +-
 epan/dissectors/packet-h450-ros.c    |    8 ++++----
 epan/dissectors/packet-lisp.c        |    8 ++++----
 epan/dissectors/packet-ncp2222.inc   |   14 ++++++++++++++
 epan/dissectors/packet-q932-ros.c    |    8 ++++----
 epan/dissectors/packet-wreth.c       |    2 +-
 epan/dissectors/packet-x509if.c      |    6 +++---
 epan/dissectors/packet-zbee-aps.c    |    2 +-
 epan/emem.h                          |    5 +++--
 epan/except.h                        |    3 ++-
 epan/proto.h                         |    3 ++-
 epan/ptvcursor.h                     |    3 ++-
 epan/to_str.h                        |    2 +-
 epan/value_string.h                  |   15 ++++++++++-----
 plugins/mate/mate_runtime.c          |    2 +-
 plugins/mate/mate_util.h             |    6 ++++--
 plugins/wimax/msg_arq.c              |   14 +++++++++++++-
 plugins/wimaxasncp/wimaxasncp_dict.l |    2 +-
 wsutil/unicode-utils.h               |    3 ++-
 28 files changed, 97 insertions(+), 57 deletions(-)