fence-agents: RHEL6 - fence_kdump: fix potential null dereference

rohara rohara at fedoraproject.org
Mon Sep 19 17:34:06 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=bc5c5b41acb78a6821bf9f2a80d324f433cec26c
Commit:        bc5c5b41acb78a6821bf9f2a80d324f433cec26c
Parent:        df491093a86637ae67cacf3dcd4b2b24f1716019
Author:        Ryan O'Hara <rohara at redhat.com>
AuthorDate:    Thu Sep 15 15:05:44 2011 -0500
Committer:     Ryan O'Hara <rohara at redhat.com>
CommitterDate: Mon Sep 19 12:28:58 2011 -0500

fence_kdump: fix potential null dereference

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 at redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto at 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")) {


More information about the cluster-commits mailing list