[PATCH 1/3] Refix concat_cmdline

Eric W. Biederman ebiederm at xmission.com
Thu Mar 11 03:20:48 EST 2010


When removing the potential leak the logic was flipped which
mean we never reached the case for handling when both parameters
were set.

Signed-off-by: Eric W. Biederman <ebiederm at aristanetworks.com>
---
 kexec/kexec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kexec/kexec.c b/kexec/kexec.c
index d282ade..43d0189 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1007,9 +1007,9 @@ char *concat_cmdline(const char *base, const char *append)
 	char *cmdline;
 	if (!base && !append)
 		return NULL;
-	if (append)
+	if (append && !base)
 		return xstrdup(append);
-	if (base)
+	if (base && !append)
 		return xstrdup(base);
 	cmdline = xmalloc(strlen(base) + 1 + strlen(append) + 1);
 	strcpy(cmdline, base);
-- 
1.6.6.1




More information about the kexec mailing list