From 92c63e2e79d224c3ca5a0023766d04b58d9b327f Mon Sep 17 00:00:00 2001 From: Bob Gilligan <gilligan@vyatta.com> Date: Mon, 1 Jun 2009 18:03:58 -0700 Subject: Bugfix 4108: Check pointers before dereferencing them. --- vyatta-restricted.c | 5 +++-- 1 file 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); } -- cgit v1.2.3