fix: address merge comments

* Re-add accidental EOF newline deletions
* Remove unnecessary entry text null-termination assertion
* Remove unnecessary has_vt_consoles check
* Make display_password_clear_text use regular bulleted behavior
  when allow_password_clear_text_toggle is false
This commit is contained in:
Simon Johnsson 2026-01-08 15:44:49 +01:00
parent 89c1c17470
commit f9b428d29a
4 changed files with 8 additions and 12 deletions

View file

@ -845,3 +845,4 @@ ply_boot_splash_uses_pixel_displays (ply_boot_splash_t *splash)
{
return splash->plugin_interface->add_pixel_display != NULL;
}

View file

@ -85,3 +85,4 @@ bool ply_keyboard_get_capslock_state (ply_keyboard_t *keyboard);
#endif
#endif /* PLY_KEYBOARD_H */

View file

@ -1613,9 +1613,7 @@ handle_ply_entry_trigger_type_password (state_t *state,
return;
}
/* Safely copy raw bytes to password_copy and ensure null-termination */
memcpy (password_copy, raw_bytes, raw_size);
password_copy[raw_size] = '\0';
ply_trace ("WARNING: cleartext password display enabled");
ply_boot_splash_display_password_clear_text (state->boot_splash,
@ -1731,16 +1729,8 @@ static void
on_tab_pressed (state_t *state)
{
ply_trace ("tab key pressed");
bool has_vt_consoles = true;
if (state->local_console_terminal != NULL) {
if (!ply_terminal_is_vt (state->local_console_terminal))
has_vt_consoles = false;
} else {
has_vt_consoles = false;
}
if (validate_input (state, "", "\t") && has_vt_consoles == true)
if (validate_input (state, "", "\t"))
toggle_between_bullets_and_clear_text (state);
}

View file

@ -2264,7 +2264,10 @@ display_password_clear_text (ply_boot_splash_plugin_t *plugin,
if (!plugin->allow_password_clear_text_toggle) {
// if function is disabled, fall back to masked bullet mode,
// as dynamically setting function to NULL is not possible
display_password_internal (plugin, prompt, NULL, 0);
int bullets = ply_utf8_string_get_length (entry_text,
strlen (entry_text));
bullets = MAX (0, bullets);
display_password_internal (plugin, prompt, NULL, bullets);
return;
}
display_password_internal (plugin, prompt, entry_text, -1);
@ -2430,3 +2433,4 @@ ply_boot_splash_plugin_get_interface (void)
return &plugin_interface;
}