projects
/
platform
/
upstream
/
bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a06fc2e
)
client: Update read callbacks with invalid offset error handlers
45/204945/1
author
Grzegorz Kolodziejczyk
<grzegorz.kolodziejczyk@codecoup.pl>
Tue, 20 Mar 2018 14:05:18 +0000
(15:05 +0100)
committer
Amit Purwar
<amit.purwar@samsung.com>
Fri, 26 Apr 2019 10:52:14 +0000
(16:22 +0530)
This patch adds invalid offset handlers to read callbacks of attributes.
Change-Id: I7c9184e0f0caf0e43c7b37eeaa40a6a12a1fd883
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
client/gatt.c
patch
|
blob
|
history
diff --git
a/client/gatt.c
b/client/gatt.c
index
7a6035a
..
3fa490b
100755
(executable)
--- a/
client/gatt.c
+++ b/
client/gatt.c
@@
-1473,6
+1473,10
@@
static DBusMessage *chrc_read_value(DBusConnection *conn, DBusMessage *msg,
parse_offset(&iter, &offset);
+ if (offset > chrc->value_len)
+ return g_dbus_create_error(msg, "org.bluez.Error.InvalidOffset",
+ NULL);
+
return read_value(msg, &chrc->value[offset], chrc->value_len - offset);
}
@@
-1831,6
+1835,10
@@
static DBusMessage *desc_read_value(DBusConnection *conn, DBusMessage *msg,
parse_offset(&iter, &offset);
+ if (offset > desc->value_len)
+ return g_dbus_create_error(msg, "org.bluez.Error.InvalidOffset",
+ NULL);
+
return read_value(msg, &desc->value[offset], desc->value_len - offset);
}