Wireshark-bugs: [Wireshark-bugs] [Bug 5534] WPS: Implements Primary Device Type decryption
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5534

--- Comment #6 from Jaap Keuter <[email protected]> 2011-02-07 12:01:10 CET ---
(In reply to comment #5)
> (In reply to comment #4)
> > (From update of attachment 5719 [details] [details])
> > hf_eapwps_tlv_primary_device_type_subcategory[tvb_get_ntohs(tvb, offset+4) - 1]
> > 
> > You cannot be sure that the index won't overrun the array boundaries, since you
> > cannot be sure you receive valid packets. Therefore this indexing has to be
> > verified first.
> 
> 
> Thanks for your review.
> 
> I have already checked the index by this code.
> 
>         tvb_get_ntohs(tvb, offset+4) > 0 &&
>         tvb_get_ntohs(tvb, offset+4) <= WPS_DEVICE_TYPE_CATEGORY_MAX) {
> 
> Is this not enough ?
> 
> Regards,
> Masahi Honma.

Ah, I see. I was expecting this to be extracted from the TVB once and stored in
a variable. That's somewhat easier to track for correctness.

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