Re: [PATCH BlueZ 4/4] input: Validate SDP HIDDescriptorList subattributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johan,

On Mon, Jan 7, 2013 at 4:27 AM, Johan Hedberg <johan.hedberg@xxxxxxxxx> wrote:
>> +     if (d->dtd < SDP_SEQ8 || d->dtd > SDP_SEQ32)
>> +             goto invalid_desc;
>
> Please always be explicit on what values you're checking for instead of
> assuming that the reader of the code knows what's contained within some
> range. In this case there's already a convenient SDP_IS_SEQ() macro you
> could use.
>
>> +     if (d->dtd < SDP_SEQ8 || d->dtd > SDP_SEQ32)
>> +             goto invalid_desc;
>
> Same here.
>
>> +     if (!d || d->dtd < SDP_TEXT_STR8 || d->dtd > SDP_TEXT_STR32)
>> +             goto invalid_desc;
>
> I suppose the best way to handle this one is to add a SDP_IS_STR() macro
> (in a separate patch) to lib/sdp.h and then use it in this patch.

Just sent a couple of patches fixing these problems and similar ones
in lib/sdp.c and health plugin source.

Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux