tipc/bearer: Prevent NULL pointer dereference

Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
Phil Sutter 2017-08-24 11:46:34 +02:00 committed by Stephen Hemminger
parent 75716932a0
commit 70a6df3962

View File

@ -439,7 +439,7 @@ static int cmd_bearer_enable(struct nlmsghdr *nlh, const struct cmd *cmd,
return err;
opt = get_opt(opts, "media");
if (strcmp(opt->val, "udp") == 0) {
if (opt && strcmp(opt->val, "udp") == 0) {
err = nl_add_udp_enable_opts(nlh, opts, cmdl);
if (err)
return err;