OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ed6482
)
attrib: Allow dec_read_resp() to just check if PDU is valid
author
Anderson Lizardo
<anderson.lizardo@openbossa.org>
Fri, 19 Jul 2013 17:34:16 +0000
(13:34 -0400)
committer
Johan Hedberg
<johan.hedberg@intel.com>
Wed, 24 Jul 2013 15:43:17 +0000
(08:43 -0700)
If a NULL "value" parameter is given, only check whether PDU is valid,
without copying attribute value to a buffer.
attrib/att.c
patch
|
blob
|
history
diff --git
a/attrib/att.c
b/attrib/att.c
index
d5f4f68
..
753c753
100644
(file)
--- 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;