* [PATCH] mesh: meshctl: Correct display security
@ 2017-12-22 10:29 sbrown
2017-12-25 19:06 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: sbrown @ 2017-12-22 10:29 UTC (permalink / raw)
To: linux-bluetooth; +Cc: sbrown
From: Steve Brown <sbrown@cortland.com>
The case of a security command without an argument is not handled
and throws a segv.
---
mesh/main.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/mesh/main.c b/mesh/main.c
index 9360481f8..7e9763a00 100644
--- a/mesh/main.c
+++ b/mesh/main.c
@@ -1670,14 +1670,19 @@ static void cmd_security(int argc, char *argv[])
uint8_t level;
char *end;
+ if (argc == 1)
+ goto done;
+
level = strtol(argv[1], &end, 10);
if (end == argv[1] || !prov_set_sec_level(level)) {
bt_shell_printf("Invalid security level %s\n", argv[1]);
return;
}
- bt_shell_printf("Provision Security Level set to %u (%s)\n", level,
- security2str(level));
+done:
+ bt_shell_printf("Provision Security Level set to %u (%s)\n",
+ prov_get_sec_level(),
+ security2str(prov_get_sec_level()));
}
static void cmd_connect(int argc, char *argv[])
--
2.14.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mesh: meshctl: Correct display security
2017-12-22 10:29 [PATCH] mesh: meshctl: Correct display security sbrown
@ 2017-12-25 19:06 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2017-12-25 19:06 UTC (permalink / raw)
To: sbrown; +Cc: linux-bluetooth
Hi Steve,
On Fri, Dec 22, 2017, sbrown@cortland.com wrote:
> The case of a security command without an argument is not handled
> and throws a segv.
> ---
> mesh/main.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-25 19:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-22 10:29 [PATCH] mesh: meshctl: Correct display security sbrown
2017-12-25 19:06 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox