From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio M. Di Nitto Date: Mon, 19 Sep 2011 19:16:05 +0200 Subject: [Cluster-devel] [PATCH 2/2] fence_kdump: fix potential null dereference In-Reply-To: <1316452260-6566-1-git-send-email-rohara@redhat.com> References: <1316452260-6566-1-git-send-email-rohara@redhat.com> Message-ID: <4E7778D5.3000205@fabbione.net> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ACK Fabio On 9/19/2011 7:11 PM, Ryan O'Hara wrote: > If strchr returns NULL while parsing options from stdin, continue > without handling the option. This should prevent possible null > dereference. > > rhbz#734429 > > Signed-off-by: Ryan O'Hara > --- > fence/agents/kdump/fence_kdump.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/fence/agents/kdump/fence_kdump.c b/fence/agents/kdump/fence_kdump.c > index 2844a3e..e224db3 100644 > --- a/fence/agents/kdump/fence_kdump.c > +++ b/fence/agents/kdump/fence_kdump.c > @@ -427,6 +427,8 @@ get_options_stdin (fence_kdump_opts_t *opts) > if ((arg = strchr (opt, '=')) != 0) { > *arg = 0; > arg += 1; > + } else { > + continue; > } > > if (!strcasecmp (opt, "nodename")) {