Skip to contentSkip to conversation

fence_kdump: fix potential null dereference

PATCH New Ryan O'Hara 2 participants 2 messages Sep 19, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 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

---
 fence/agents/kdump/fence_kdump.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fence/agents/kdump/fence_kdump.c +2 -0
index 2844a3e..e224db3 100644
@@ -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")) {
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 2/2 fence_kdump: fix potential null dereference

ACK

Fabio

Quoted 24 lines · Ryan O'Hara

If strchr returns NULL while parsing options from stdin, continue without handling the option. This should prevent possible null dereference.

rhbz#734429

---
 fence/agents/kdump/fence_kdump.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fence/agents/kdump/fence_kdump.c +2 -0
index 2844a3e..e224db3 100644
@@ -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")) {