diff options
author | Bob Gilligan <gilligan@vyatta.com> | 2009-06-01 18:03:58 -0700 |
---|---|---|
committer | Bob Gilligan <gilligan@vyatta.com> | 2009-06-01 18:03:58 -0700 |
commit | 22b61bdd9b69de8bcdbbccc274b4eda0eea9d0ca (patch) | |
tree | 9a9c89d08ad3ab71dc82d38010db86212a59a191 | |
parent | 99f116e2631141e88caff0b65ad516ac4ceed3f1 (diff) | |
download | vyatta-bash-22b61bdd9b69de8bcdbbccc274b4eda0eea9d0ca.tar.gz vyatta-bash-22b61bdd9b69de8bcdbbccc274b4eda0eea9d0ca.zip |
Bugfix 4108: Check pointers before dereferencing them.
-rw-r--r-- | vyatta-restricted.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vyatta-restricted.c b/vyatta-restricted.c index 50612f8..c0337e7 100644 --- a/vyatta-restricted.c +++ b/vyatta-restricted.c @@ -174,9 +174,10 @@ vyatta_check_expansion(COMMAND *cmd, int full) switch (cmd->type) { case cm_simple: cS = cmd->value.Simple; - if (!(cS->redirects)) { + if (cS && !(cS->redirects)) { /* simple command, no redirects */ - if (is_in_command_list(cS->words->word->word, expand_disable_cmds)) { + if (cS->words && cS->words->word && + is_in_command_list(cS->words->word->word, expand_disable_cmds)) { /* user command => quote all words */ make_restricted_wordlist(cS->words); } |