ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-bugs: [Wireshark-bugs] [Bug 2067] New: mergecap fails when "time_t" is "int"

Date: Sun, 2 Dec 2007 21:19:07 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2067

           Summary: mergecap fails when "time_t" is "int"
           Product: Wireshark
           Version: SVN
          Platform: PC
        OS/Version: OpenBSD
            Status: NEW
          Severity: Minor
          Priority: Low
         Component: Extras
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: nikns@xxxxxxxxx


Build Information:

--
When "time_t" is "int" (for example on OpenBSD), mergecap fails because of:

-----------merge.c-------------------------
[..]
wtap* merge_read_packet(..) 
{
struct wtap_nstime tv = {LONG_MAX, LONG_MAX};
}
[..]
-----------wiretap/wtap.h------------------
[..]
struct wtap_nstime {
        time_t  secs;
        int     nsecs;
};
[..]
--------------------------------------------

As you see, if "time_t" is "int", "LONG_MAX" assignation overflows "tv" value.

The solution would be to make "wtap_nstime" element "secs" of type "int" and to
"tv" assign INT_MAX.


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.