https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5476

--- Comment #4 from Anders Broman <anders.bro...@ericsson.com> 2010-12-10 
06:54:03 PST ---
Hi,
I'm doubtful of this code:
            switch(opt_len){
                case 16: 
                    memset(&prefix, 0, sizeof(prefix));
                    tvb_memcpy(tvb, (guint8 *)&prefix, opt_offset, 8);
                    proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_prefix,
tvb, opt_offset, 8, prefix.bytes);
                    proto_item_append_text(ti, " %s/%d", ip6_to_str(&prefix),
prefix_len);
                break;
                case 24: 
                    tvb_get_ipv6(tvb, opt_offset, &prefix);
                    proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix,
tvb, opt_offset, 16, FALSE);
                    proto_item_append_text(ti, " %s/%d", ip6_to_str(&prefix),
prefix_len);
                break;
                default:
                    expert_add_info_format(pinfo, ti_opt_len, PI_MALFORMED,
PI_ERROR, "Invalid Option Length");
                break;     
            }
Isn't the possible valid opt_lens 8, 16 and 24?
Shouldn't  
tvb_memcpy(tvb, (guint8 *)&prefix, opt_offset, 8);
Be
tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8);

>Also, the copy for section RFC is needed ?
Well I'd like it to be there...
Regards
Anders

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
___________________________________________________________________________
Sent via:    Wireshark-bugs mailing list <wireshark-bugs@wireshark.org>
Archives:    http://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://wireshark.org/mailman/options/wireshark-bugs
             mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe

Reply via email to