From 18e672fa2f38d9cd533267abd6bbaf1454f795ab Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Tue, 31 Jul 2018 16:37:12 +0200 Subject: [PATCH] client: Make sure network_args.type is initialised Otherwise match_by_device_and_args might segfault. --- client/device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/device.c b/client/device.c index 9049e4a9..c0a37649 100644 --- a/client/device.c +++ b/client/device.c @@ -770,8 +770,7 @@ static enum cmd_status cmd_connect(const char *device_name, return CMD_STATUS_INVALID_ARGS; network_args.name = argv[0]; - if (argc >= 2) - network_args.type = argv[1]; + network_args.type = argc >= 2 ? argv[1] : NULL; match = network_match_by_device_and_args(device_proxy, &network_args); if (!match) {