Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] android/gatt: Don't process read_by_type request with invalied range
@ 2014-05-22 10:33 Marcin Kraglak
  2014-05-22 12:04 ` Szymon Janc
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Kraglak @ 2014-05-22 10:33 UTC (permalink / raw)
  To: linux-bluetooth

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] android/gatt: Don't process read_by_type request with invalied range
  2014-05-22 10:33 [PATCH] android/gatt: Don't process read_by_type request with invalied range Marcin Kraglak
@ 2014-05-22 12:04 ` Szymon Janc
  0 siblings, 0 replies; 2+ messages in thread
From: Szymon Janc @ 2014-05-22 12:04 UTC (permalink / raw)
  To: Marcin Kraglak; +Cc: linux-bluetooth

Hi Marcin,

On Thursday 22 of May 2014 12:33:55 Marcin Kraglak wrote:
> 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;
> 

Applied, thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-22 12:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-22 10:33 [PATCH] android/gatt: Don't process read_by_type request with invalied range Marcin Kraglak
2014-05-22 12:04 ` Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox