2019-07-03 19:09:20

by Michał Lowas-Rzechonek

[permalink] [raw]
Subject: [PATCH BlueZ] mesh: Fix stack overflow in get_element_properties

From: Michał 'Khorne' Lowas-Rzechonek <[email protected]>

D-Bus type 'q' denotes uint16, not uint8.
---
mesh/node.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mesh/node.c b/mesh/node.c
index c73ba541f..f9be96cbd 100644
--- a/mesh/node.c
+++ b/mesh/node.c
@@ -1200,7 +1200,7 @@ static bool get_element_properties(struct mesh_node *node, const char *path,

while (l_dbus_message_iter_next_entry(properties, &key, &var)) {
if (!strcmp(key, "Location")) {
- uint8_t loc;
+ uint16_t loc;

l_dbus_message_iter_get_variant(&var, "q", &loc);

--
2.20.1


2019-07-04 00:16:41

by Gix, Brian

[permalink] [raw]
Subject: Re: [PATCH BlueZ] mesh: Fix stack overflow in get_element_properties

Applied

On Wed, 2019-07-03 at 21:08 +0200, Michał Lowas-Rzechonek wrote:
> From: Michał 'Khorne' Lowas-Rzechonek <[email protected]>
>
> D-Bus type 'q' denotes uint16, not uint8.
> ---
> mesh/node.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mesh/node.c b/mesh/node.c
> index c73ba541f..f9be96cbd 100644
> --- a/mesh/node.c
> +++ b/mesh/node.c
> @@ -1200,7 +1200,7 @@ static bool get_element_properties(struct mesh_node *node, const char *path,
>
> while (l_dbus_message_iter_next_entry(properties, &key, &var)) {
> if (!strcmp(key, "Location")) {
> - uint8_t loc;
> + uint16_t loc;
>
> l_dbus_message_iter_get_variant(&var, "q", &loc);
>