From a48a3bac3ab1e12ea145ca46dd30cdf948761a73 Mon Sep 17 00:00:00 2001 From: Vinicius Costa Gomes Date: Wed, 10 Oct 2012 20:35:01 -0300 Subject: [PATCH] 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. --- attrib/att.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.47.3