From: D Scott Phillips Date: Mon, 26 Jan 2026 17:25:32 +0000 (-0800) Subject: ply-keyboard: Fix hang on read of incomplete terminal control sequence X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;p=thirdparty%2Fplymouth.git ply-keyboard: Fix hang on read of incomplete terminal control sequence It's possible for a read from the terminal to provide a partial command sequence, starting with the CSI ('\x1b\x5b') but not terminating with its function character ('\x40'..'\x7e'). In that case, the input byte handling loop would not terminate, causing plymouthd to hang both itself and possibly completion of the boot. Break from the input byte handling loop when an incomplete command sequence is found so that the program does not hang. The incomplete command sequence will remain in the input buffer so that a later completion of the command sequence can be handled. Fixes: b41e40e065c6 ("Add support for CSI sequences") Fixes: plymouth/plymouth#321 Link: https://bugzilla.redhat.com/show_bug.cgi?id=2433079 --- diff --git a/src/libply-splash-core/ply-keyboard.c b/src/libply-splash-core/ply-keyboard.c index 59f125fe..dc19f5cc 100644 --- a/src/libply-splash-core/ply-keyboard.c +++ b/src/libply-splash-core/ply-keyboard.c @@ -315,7 +315,7 @@ on_key_event (ply_keyboard_t *keyboard, */ } if (csi_seq_size == 0) /* No final byte found */ - continue; + break; process_keyboard_input (keyboard, bytes + i, csi_seq_size); i += csi_seq_size; continue;