summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-02 13:15:56 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-02 13:15:56 -0700
commit772405499e3c3d99865f6cc371727cd75fc71cc7 (patch)
treeee69568b794ba986d8e6a38f80c41295a675f447
parent26f0c1e6171b5426c9760c01c9e43a3fb9f67496 (diff)
downloadvyatta-bash-772405499e3c3d99865f6cc371727cd75fc71cc7.tar.gz
vyatta-bash-772405499e3c3d99865f6cc371727cd75fc71cc7.zip
Fix null reference in command logging
When doing command completion, the sub-process is not a command so it has no information, therefore don't log it.
-rw-r--r--logging.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/logging.c b/logging.c
index 93838b5..f21d2a7 100644
--- a/logging.c
+++ b/logging.c
@@ -74,7 +74,10 @@ void log_process_exit (child)
size_t cc;
struct command_log *lrec;
- if (message_queue == (mqd_t) -1)
+ if (message_queue == (mqd_t) -1) /* message queue does not exist */
+ return;
+
+ if (child->command == NULL) /* no command info */
return;
cc = sizeof(*lrec) + strlen(child->command) + 1;