From: Marcin Kraglak <marcin.kraglak@tieto.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] android/gatt: Don't process read_by_type request with invalied range
Date: Thu, 22 May 2014 12:33:55 +0200 [thread overview]
Message-ID: <1400754835-3325-1-git-send-email-marcin.kraglak@tieto.com> (raw)
Return ATT_ECODE_INVALID_HANDLE if range is incorrect. It repairs
TC_GAR_SR_BI_08_C test case.
---
android/gatt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/android/gatt.c b/android/gatt.c
index 89da60d..dae0df3 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -4404,6 +4404,9 @@ static uint8_t read_by_type(const uint8_t *cmd, uint16_t cmd_len,
if (!len)
return ATT_ECODE_INVALID_PDU;
+ if (start > end)
+ return ATT_ECODE_INVALID_HANDLE;
+
q = queue_new();
if (!q)
return ATT_ECODE_INSUFF_RESOURCES;
--
1.9.0
next reply other threads:[~2014-05-22 10:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-22 10:33 Marcin Kraglak [this message]
2014-05-22 12:04 ` [PATCH] android/gatt: Don't process read_by_type request with invalied range Szymon Janc
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=1400754835-3325-1-git-send-email-marcin.kraglak@tieto.com \
--to=marcin.kraglak@tieto.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