Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] packet-camel possibly incorrect code ....

From: "Anders Broman" <anders.broman@xxxxxxxxxxxx>
Date: Tue, 26 Jan 2010 17:54:08 +0100
Hi,
I removed redundant code in revision 31683.
Regards
Anders 

-----Original Message-----
From: wireshark-dev-bounces@xxxxxxxxxxxxx
[mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Bill Meier
Sent: den 26 januari 2010 02:59
To: Developer support list for Wireshark
Subject: [Wireshark-dev] packet-camel possibly incorrect code ....

While fixing various gcc -Wshadow warnings I came across something which
seems incorrect in packet-camel-template.c in dissect-camel_arg() (and
in dissect_camel_res()).

Specifically: the local variable 'opcode' seems to be set but is never
used.

There is a global variable 'opcode' so I'm suspecting that the local
declaration shouldn't be there.

Can someone who is familiar with the code confirm this ?

Thanks

Bill

--------------------

static int
dissect_camel_arg(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree
*tree _U_) {
   int offset;
   rose_ctx_t *rctx;
   gint32 opcode;
   /*
   const camel_op_t *op_ptr;
   const gchar *p;
   proto_item *ti, *ti_tmp;
   proto_tree *camel_tree;
*/
   offset = 0;
   rctx = get_rose_ctx(pinfo->private_data);
   DISSECTOR_ASSERT(rctx);
   if (rctx->d.pdu != 1)  /* invoke */
     return offset;
   if (rctx->d.code != 0)  /* local */
     return offset;
   opcode = rctx->d.code_local;

   return offset;
}
________________________________________________________________________
___
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
 
mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe