commit 18e672fa2f38d9cd533267abd6bbaf1454f795ab
parent 61bdb7e19f27359d5f13833f79392a4e2189dc0e
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Tue, 31 Jul 2018 16:37:12 +0200
client: Make sure network_args.type is initialised
Otherwise match_by_device_and_args might segfault.
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git 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) {