diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-02 13:15:56 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-02 13:15:56 -0700 |
commit | 772405499e3c3d99865f6cc371727cd75fc71cc7 (patch) | |
tree | ee69568b794ba986d8e6a38f80c41295a675f447 | |
parent | 26f0c1e6171b5426c9760c01c9e43a3fb9f67496 (diff) | |
download | vyatta-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |