]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Don't crash if the user presses enter when a password isn't being asked for
authorRay Strode <rstrode@redhat.com>
Wed, 28 May 2008 19:41:27 +0000 (15:41 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 28 May 2008 19:41:27 +0000 (15:41 -0400)
src/splash-plugins/spinfinity/spinfinity.c

index 12534d4fc88903bd6dba5f2eb4eb3c1aefea9b20..f1e9c11f485d9cbf737e0e6adda72495e0b72605 100644 (file)
@@ -441,11 +441,19 @@ void
 on_enter (ply_boot_splash_plugin_t *plugin,
           const char               *text)
 {
+  if (plugin->password_answer_handler == NULL)
+    return;
+
   plugin->password_answer_handler (plugin->password_answer_data,
                                    text);
-  plugin->entry->number_of_bullets = 0;
-  entry_free (plugin->entry);
-  plugin->entry = NULL;
+
+  if (plugin->entry != NULL)
+    {
+      plugin->entry->number_of_bullets = 0;
+      entry_free (plugin->entry);
+      plugin->entry = NULL;
+    }
+
   start_animation (plugin);
 }