summaryrefslogtreecommitdiff
path: root/attrib/gatttool.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2010-10-05 13:50:03 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2010-10-05 13:50:03 +0200
commit89c9634c10f3eb73c577d001e943e46d4fb13302 (patch)
treec8fc22e1b44e08f6ca371991aed127758493c104 /attrib/gatttool.c
parent77bce046cb2387b2c2ed7757ab5c37fa1a6a4766 (diff)
downloadbluez-89c9634c10f3eb73c577d001e943e46d4fb13302.tar.gz
gatttool: fix trying to read beyond the last handle
Diffstat (limited to 'attrib/gatttool.c')
-rw-r--r--attrib/gatttool.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index 4a6634094..76fe62c01 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
@@ -183,6 +183,10 @@ static void primary_cb(guint8 status, const guint8 *pdu, guint16 plen,
att_data_list_free(list);
+ /* Don't go beyond the maximum handle value */
+ if (end == 0xffff)
+ goto done;
+
/*
* Discover all primary services sub-procedure shall send another
* Read by Group Type Request until Error Response is received and