cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Ryan O'Hara <rohara@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 2/2] fence_kdump: fix potential null dereference
Date: Mon, 19 Sep 2011 12:11:00 -0500	[thread overview]
Message-ID: <1316452260-6566-1-git-send-email-rohara@redhat.com> (raw)

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 <rohara@redhat.com>
---
 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")) {
-- 
1.7.3.4



             reply	other threads:[~2011-09-19 17:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-19 17:11 Ryan O'Hara [this message]
2011-09-19 17:16 ` [Cluster-devel] [PATCH 2/2] fence_kdump: fix potential null dereference Fabio M. Di Nitto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1316452260-6566-1-git-send-email-rohara@redhat.com \
    --to=rohara@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).