Wireshark-commits: [Wireshark-commits] master f2b4daf: Add printf-format annotations, fix garbage
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=f2b4daf4005d60eef7e34e2e6ebf4fe487d3c255
Submitter: Evan Huus (eapache@xxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
f2b4daf 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>
Actions performed:
from ec6a22d Workaround for ASAN failure in _ws_mempbrk_sse42
adds f2b4daf 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(-)