2014-12-16 07:51:35

by Marcin Kraglak

[permalink] [raw]
Subject: [PATCH] attrib: Fix Read Blob error responses

Read blob response with offset equal to value length should return
zero length value intead of Invalid Offset Error.
Found during qualification test case TC/GAR/SR/BV-08-C Read behind
Long Characteristic Descriptor.
---
src/attrib-server.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/attrib-server.c b/src/attrib-server.c
index 6571577..69e6cdc 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -856,7 +856,7 @@ static uint16_t read_blob(struct gatt_channel *channel, uint16_t handle,

a = l->data;

- if (a->len <= offset)
+ if (a->len < offset)
return enc_error_resp(ATT_OP_READ_BLOB_REQ, handle,
ATT_ECODE_INVALID_OFFSET, pdu, len);

--
1.9.3



2015-02-05 10:18:47

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] attrib: Fix Read Blob error responses

Hi Marcin,

On Tue, Dec 16, 2014, Marcin Kraglak wrote:
> Read blob response with offset equal to value length should return
> zero length value intead of Invalid Offset Error.
> Found during qualification test case TC/GAR/SR/BV-08-C Read behind
> Long Characteristic Descriptor.
> ---
> src/attrib-server.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied. Thanks.

Johan

2015-02-03 07:38:19

by Marcin Kraglak

[permalink] [raw]
Subject: Re: [PATCH] attrib: Fix Read Blob error responses

On 16 December 2014 at 08:51, Marcin Kraglak <[email protected]> wrote:
> Read blob response with offset equal to value length should return
> zero length value intead of Invalid Offset Error.
> Found during qualification test case TC/GAR/SR/BV-08-C Read behind
> Long Characteristic Descriptor.
> ---
> src/attrib-server.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/attrib-server.c b/src/attrib-server.c
> index 6571577..69e6cdc 100644
> --- a/src/attrib-server.c
> +++ b/src/attrib-server.c
> @@ -856,7 +856,7 @@ static uint16_t read_blob(struct gatt_channel *channel, uint16_t handle,
>
> a = l->data;
>
> - if (a->len <= offset)
> + if (a->len < offset)
> return enc_error_resp(ATT_OP_READ_BLOB_REQ, handle,
> ATT_ECODE_INVALID_OFFSET, pdu, len);
>
> --
> 1.9.3
>

Ping

--
BR
Marcin Kraglak