public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [RFC] Bluetooth: don't increment twice in eir_has_data_type()
Date: Thu, 22 Mar 2012 09:28:01 +0300	[thread overview]
Message-ID: <20120322062801.GA3232@mwanda> (raw)
In-Reply-To: <20120321220632.GA14964@x220.amr.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 969 bytes --]

On Wed, Mar 21, 2012 at 07:06:32PM -0300, Johan Hedberg wrote:
> Looks like the original code is indeed buggy, no idea how I didn't
> notice something that obvious. Your patch does however seem to change
> the behavior a bit, a valid tag would be detected even though its length
> would be invalid (pointing outside of the supplied data). Not sure if
> that's so critical though since the important thing is to keep the code
> from doing anything nasty when supplied invalid data.
> 

We should check the length.  It will just cause headaches if we
don't.

It would be simple enough for me to put back the check I removed
from the middle of the loop.  But the thing is I wasn't sure how all
the + 1 and - 1 things fit together so I didn't feel good about
signing off on this.  Could you send a patch?  That way I get a
reported-by tag but if there are any problems you get blamed while I
deny knowing anything about it.  ;)

regards,
dan carpenter

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-03-22  6:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 15:06 [RFC] Bluetooth: don't increment twice in eir_has_data_type() Dan Carpenter
2012-03-21 22:06 ` Johan Hedberg
2012-03-22  6:28   ` Dan Carpenter [this message]
2012-03-26 11:30     ` Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120322062801.GA3232@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox