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