Wireshark-bugs: [Wireshark-bugs] [Bug 2893] New: "fill_label_uint" doesn't handle fields with RV
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2893

           Summary: "fill_label_uint" doesn't handle fields with RVALS
                    (range) values
           Product: Wireshark
           Version: 1.0.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Medium
         Component: Wireshark
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Build Information:
1.0.99

Compiled with GTK+ 2.12.11, with GLib 2.16.5, with WinPcap (version unknown),
with libz 1.2.3, without POSIX capabilities, with libpcre 7.0, with SMI 0.4.8,
with c-ares 1.5.2, without ADNS, with Lua 5.1, with GnuTLS 2.3.8, with Gcrypt
1.4.1, with MIT Kerberos, with PortAudio V19-devel (built Aug 30 2008), with
AirPcap.

Running on Windows XP Service Pack 2, build 2600, with WinPcap version 4.0.2
(packet.dll version 4.0.0.1040), based on libpcap version 0.9.5, without
AirPcap.

Built using Microsoft Visual C++ 8.0 build 50727

--
"fill_label_uint" function in epan/proto.c does not handle RVALS correctly:

Current code:


        else if (hfinfo->strings) {
                format = hfinfo_uint_vals_format(hfinfo);
                ret = g_snprintf(label_str, ITEM_LABEL_LENGTH,
                                format,  hfinfo->name,
                val_to_str(value, cVALS(hfinfo->strings), "Unknown"), value);
        }

Fix:

else if (hfinfo->strings) {
        format = hfinfo_uint_vals_format(hfinfo);       

        if (hfinfo->display & BASE_RANGE_STRING) {
              ret = g_snprintf(label_str, ITEM_LABEL_LENGTH,
                        format,  hfinfo->name,
                        rval_to_str(value, hfinfo->strings, "Unknown"), value);

        } else {

              ret = g_snprintf(label_str, ITEM_LABEL_LENGTH,
                               format,  hfinfo->name,
                   val_to_str(value, cVALS(hfinfo->strings), "Unknown"),
value);

        }

}


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