If a NULL "value" parameter is given, only check whether PDU is valid, without copying attribute value to a buffer. --- attrib/att.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/attrib/att.c b/attrib/att.c index d2b78bd..14871d9 100644 --- a/attrib/att.c +++ b/attrib/att.c @@ -703,12 +703,12 @@ ssize_t dec_read_resp(const uint8_t *pdu, size_t len, uint8_t *value, size_t vle 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; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html