3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

client: check NULL return for DPP cmd_show

If the DPP interface goes away this could return NULL which was
unchecked. Caught by static analysis.
This commit is contained in:
James Prestwood 2022-07-07 10:55:03 -07:00 committed by Denis Kenzior
parent 3ccaf7beed
commit da8a87fcf5

View File

@ -284,6 +284,11 @@ static enum cmd_status cmd_show(const char *device_name,
device_proxy_find(device_name, IWD_DPP_INTERFACE);
char *caption = l_strdup_printf("%s: %s", "DPP", device_name);
if (!proxy) {
display("No DPP interface on device: '%s'\n", device_name);
return CMD_STATUS_INVALID_VALUE;
}
proxy_properties_display(proxy, caption, MARGIN, 20, 47);
l_free(caption);