From: Ray Strode Date: Wed, 27 Aug 2008 16:10:08 +0000 (-0400) Subject: Don't try to use cached passwords if none get returned X-Git-Tag: 0.6.0~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6da3b8ffa600dc040fbe689e9db58e8a51e4d375;p=thirdparty%2Fplymouth.git Don't try to use cached passwords if none get returned It causes a pretty instant crash. --- diff --git a/src/client/plymouth.c b/src/client/plymouth.c index 2ba457c6..d8b60c5c 100644 --- a/src/client/plymouth.c +++ b/src/client/plymouth.c @@ -204,19 +204,21 @@ on_multiple_answers (answer_state_t *answer_state, assert (answer_state->command != NULL); need_to_ask_user = true; - for (i = 0; answers[i] != NULL; i++) - { - bool command_started; - exit_status = 127; - command_started = answer_via_command (answer_state, answers[i], - &exit_status); - if (command_started && WIFEXITED (exit_status) && - WEXITSTATUS (exit_status) == 0) - { - need_to_ask_user = false; - break; - } - } + + if (answers != NULL) + for (i = 0; answers[i] != NULL; i++) + { + bool command_started; + exit_status = 127; + command_started = answer_via_command (answer_state, answers[i], + &exit_status); + if (command_started && WIFEXITED (exit_status) && + WEXITSTATUS (exit_status) == 0) + { + need_to_ask_user = false; + break; + } + } if (need_to_ask_user) {