[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170818092422.3c178db7@xeon-e3>
Date: Fri, 18 Aug 2017 09:24:22 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Phil Sutter <phil@....cc>
Cc: netdev@...r.kernel.org
Subject: Re: [iproute PATCH v2 5/5] tipc/bearer: Prevent NULL pointer
dereference
On Thu, 17 Aug 2017 19:09:31 +0200
Phil Sutter <phil@....cc> wrote:
> - opt = get_opt(opts, "media");
> - if (strcmp(opt->val, "udp") == 0) {
> + if ((opt = get_opt(opts, "media")) &&
> + strcmp(opt->val, "udp") == 0) {
Please don't merge assignment and comparison unless necessary for other reasons.
opt = get_opt(opts, "media");
if (opt && strcmp(opt->val, "udp") == 0) {
Powered by blists - more mailing lists