]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Don't try to use cached passwords if none get returned
authorRay Strode <rstrode@redhat.com>
Wed, 27 Aug 2008 16:10:08 +0000 (12:10 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 27 Aug 2008 16:10:08 +0000 (12:10 -0400)
It causes a pretty instant crash.

src/client/plymouth.c

index 2ba457c6ce880b11eac1c1933c9c37e00d45ab46..d8b60c5c4f3c82bb3b0c3d624a1742b19ec24802 100644 (file)
@@ -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)
     {