From 6d8d1a59bc2b3012216c53624d1689822b4f21e1 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 4 Jun 2013 09:37:34 +0300 Subject: [PATCH] alert: Fix invalid read past end of buffer --- profiles/alert/server.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/profiles/alert/server.c b/profiles/alert/server.c index 58c8b03a5..8da192835 100644 --- a/profiles/alert/server.c +++ b/profiles/alert/server.c @@ -854,6 +854,9 @@ static uint8_t alert_notif_cp_write(struct attribute *a, { DBG("a = %p", a); + if (a->len < 2) + return 0; + switch (a->data[0]) { case ENABLE_NEW_INCOMING: DBG("ENABLE_NEW_INCOMING: 0x%02x", a->data[1]); -- 2.47.3