Wireshark-bugs: [Wireshark-bugs] [Bug 7312] New: division by zero in cli/tap-iostat.c (CIDs 7023

Date: Thu, 31 May 2012 14:26:22 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7312

           Summary: division by zero in cli/tap-iostat.c (CIDs 702378,
                    702379, 702380)
           Product: Wireshark
           Version: SVN
          Platform: x86
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Low
         Component: TShark
        AssignedTo: bugzilla-admin@xxxxxxxxxxxxx
        ReportedBy: wireshark@xxxxxxxxx


Build Information:
svn r42947, linux
--
Dear all

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.

Best regards,

   Martin

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.