From 6e15d6c6f3bdb5750bb08c6db770c4bfc5eebbaf Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Thu, 19 Mar 2009 11:05:51 -1000 Subject: Avoid SIGSEGV in doPwMount() when NULL is last parameter (#491192) If NULL is given as the last parameter to doPwMount(), do not try to dereference it. --- isys/imount.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'isys') diff --git a/isys/imount.c b/isys/imount.c index 614e67ee6..fd51fdefa 100644 --- a/isys/imount.c +++ b/isys/imount.c @@ -146,9 +146,11 @@ int doPwMount(char *dev, char *where, char *fs, char *options, char **err) { close(pipefd[1]); - if (*err != NULL) { - rc = readFD(pipefd[0], err); - rc = write(programLogFD, *err, 4096); + if (err != NULL) { + if (*err != NULL) { + rc = readFD(pipefd[0], err); + rc = write(programLogFD, *err, 4096); + } } close(pipefd[0]); -- cgit