summaryrefslogtreecommitdiff
path: root/attrib/att.c
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2012-10-10 20:35:01 -0300
committerJohan Hedberg <johan.hedberg@intel.com>2012-10-11 08:48:09 +0200
commita48a3bac3ab1e12ea145ca46dd30cdf948761a73 (patch)
tree1f17045934a4b354c83b600bd761fe3586471da1 /attrib/att.c
parent9111ffe1c0f680d8c8a4a19888d630888c6e4db5 (diff)
downloadbluez-a48a3bac3ab1e12ea145ca46dd30cdf948761a73.tar.gz
att: Fix sending pdu's with invalid data
When encoding an att_data_list we need to make sure that each element lenght of the data list will not exceed 255, because that information will be encoded as a octet later.
Diffstat (limited to 'attrib/att.c')
-rw-r--r--attrib/att.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/attrib/att.c b/attrib/att.c
index fc510f4fb..f262bb608 100644
--- a/attrib/att.c
+++ b/attrib/att.c
@@ -101,6 +101,9 @@ struct att_data_list *att_data_list_alloc(uint16_t num, uint16_t len)
struct att_data_list *list;
int i;
+ if (len > UINT8_MAX)
+ return NULL;
+
list = g_new0(struct att_data_list, 1);
list->len = len;
list->num = num;