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
This commit is contained in:
parent
5690373d48
commit
698ad5bd95
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue