Diff between 1ed64821ac7ec9ed1c6cfe197257e47c58f2494c and 638790716fa36c221f35bd2639754b6d43798741
Changed Files
| File | Additions | Deletions | Status |
| attrib/att.c | +3 | -3 | modified |
Full Patch
diff --git a/attrib/att.c b/attrib/att.c
index d5f4f68..753c753 100644
--- a/attrib/att.c
+++ b/attrib/att.c
@@ -704,12 +704,12 @@ ssize_t dec_read_resp(const uint8_t *pdu, size_t len, uint8_t *value,
if (pdu == NULL)
return -EINVAL;
- if (value == NULL)
- return -EINVAL;
-
if (pdu[0] != ATT_OP_READ_RESP)
return -EINVAL;
+ if (value == NULL)
+ return len - 1;
+
if (vlen < (len - 1))
return -ENOBUFS;