diff options
author | Gerald Combs <gerald@wireshark.org> | 2012-05-31 21:40:55 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2012-05-31 21:40:55 +0000 |
commit | 698ad5bd95c62005fb049b71475844889836210e (patch) | |
tree | d3fe2303952ce7e10fc80f1d1700a5cec4e972f4 /ui/cli | |
parent | 5690373d48d78a5380d1d20b86a6db9a6235cc86 (diff) | |
download | wireshark-698ad5bd95c62005fb049b71475844889836210e.tar.gz |
From Martin Kaiser via bug 7312:
there's three coverity defects about division by zero in ui/cli/tap-iostat.c,
function iostat_packet()
This can be triggered from the command line
martin@greta# ./tshark -z io,stat,0.2,AVG\(frame.number\)
Capturing on eth0
Floating point exception
it->num is 0, wireshark crashes in
parent->max_vals[it->colnum] =
MAX(parent->max_vals[it->colnum], it->counter/it->num);
(and similar for other data types)
My proposal for a fix is to not update parent->max_vals[it->colnum] when
it->num==0, see the attached patch.
svn path=/trunk/; revision=42952
Diffstat (limited to 'ui/cli')
-rw-r--r-- | ui/cli/tap-iostat.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/cli/tap-iostat.c b/ui/cli/tap-iostat.c index c9a51d1e5b..f0d18a3a62 100644 --- a/ui/cli/tap-iostat.c +++ b/ui/cli/tap-iostat.c @@ -467,6 +467,8 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du } break; case CALC_TYPE_AVG: + if (it->num==0) /* avoid division by zero */ + break; ftype=proto_registrar_get_ftype(it->hf_index); switch(ftype) { case FT_FLOAT: |