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
*/
}
if (csi_seq_size == 0) /* No final byte found */
*/
}
if (csi_seq_size == 0) /* No final byte found */
process_keyboard_input (keyboard, bytes + i, csi_seq_size);
i += csi_seq_size;
continue;
process_keyboard_input (keyboard, bytes + i, csi_seq_size);
i += csi_seq_size;
continue;