summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2009-06-01 18:03:58 -0700
committerBob Gilligan <gilligan@vyatta.com>2009-06-02 14:11:25 -0700
commit92c63e2e79d224c3ca5a0023766d04b58d9b327f (patch)
tree76425e942aaa89aead56d86b1d661906ea147014
parentc454e7e62a0ee2188c1d24832288cea526d87acf (diff)
downloadvyatta-bash-92c63e2e79d224c3ca5a0023766d04b58d9b327f.tar.gz
vyatta-bash-92c63e2e79d224c3ca5a0023766d04b58d9b327f.zip
Bugfix 4108: Check pointers before dereferencing them.
-rw-r--r--vyatta-restricted.c5
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);
}