Wireshark-bugs: [Wireshark-bugs] [Bug 1102] New: Japan MTP3 PCs not set in columns if unstructur

Date: Thu, 14 Sep 2006 06:36:18 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1102

           Summary: Japan MTP3 PCs not set in columns if unstructured
                    display
           Product: Wireshark
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: jeff.morriss@xxxxxxxxxxx


The MTP3 dissector (packet-mtp3.c) has this code:

~~~
    label_opc_item = proto_tree_add_item(label_tree, hf_mtp3_japan_opc, tvb,
JAPAN_OPC_OFFSET, JAPAN_PC_LENGTH, TRUE);
    if (mtp3_pc_structured()) {
      opc = tvb_get_letohs(tvb, JAPAN_OPC_OFFSET);
~~~

but 'opc' is used later in the function

~~~
  mtp3_addr_opc.type = mtp3_standard;
  mtp3_addr_opc.pc = opc;
  SET_ADDRESS(&pinfo->src, AT_SS7PC, sizeof(mtp3_addr_opc), (guint8 *)
&mtp3_addr_opc);
~~~

Same goes for 'dpc'.

NOTE: 'gcc' would have warned about this except that the variables are
initialized to 0 when they are declared:

  guint32 label, dpc = 0, opc = 0;

Need to move the setting of the local 'opc' variable out of the 'if' and remove
those initializations so the compiler will warn me the next time I make such a
mistake.

I can submit a patch but I'm traveling now (I open the bug so I won't forget);
else if someone else can just make the change, that would be great.


-- 
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.