WSL2-Linux-Kernel/drivers/accessibility/speakup
Samuel Thibault 967e74124f speakup: Fix 8bit characters from direct synth
[ Upstream commit b6c8dafc9d86eb77e502bb018ec4105e8d2fbf78 ]

When userland echoes 8bit characters to /dev/synth with e.g.

echo -e '\xe9' > /dev/synth

synth_write would get characters beyond 0x7f, and thus negative when
char is signed.  When given to synth_buffer_add which takes a u16, this
would sign-extend and produce a U+ffxy character rather than U+xy.
Users thus get garbled text instead of accents in their output.

Let's fix this by making sure that we read unsigned characters.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Fixes: 89fc2ae80b ("speakup: extend synth buffer to 16bit unicode characters")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240204155736.2oh4ot7tiaa2wpbh@begin
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-10 16:18:40 +02:00
..
DefaultKeyAssignments
Kconfig speakup: only build serialio when ISA is enabled 2020-08-18 13:15:34 +02:00
Makefile speakup: only build serialio when ISA is enabled 2020-08-18 13:15:34 +02:00
TODO
buffers.c
devsynth.c
fakekey.c
i18n.c speakup: use C99 syntax for array initializers 2021-07-21 13:45:53 +02:00
i18n.h speakup: Separate out translations for bright colors names 2021-06-15 17:07:46 +02:00
keyhelp.c
kobjects.c
main.c speakup: fix a segfault caused by switching consoles 2022-11-26 09:24:44 +01:00
selection.c speakup: Fix clearing selection in safe context 2020-11-09 18:14:20 +01:00
serialio.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
serialio.h
speakup.h speakup: Fix clearing selection in safe context 2020-11-09 18:14:20 +01:00
speakup_acnt.h
speakup_acntpc.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_acntsa.c
speakup_apollo.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_audptr.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_bns.c
speakup_decext.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_decpc.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_dectlk.c speakup-dectlk: Restore pitch setting 2022-02-16 12:56:37 +01:00
speakup_dtlk.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_dtlk.h
speakup_dummy.c speakup_dummy: log about characters received by the dummy driver 2020-11-09 18:15:32 +01:00
speakup_keypc.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_ltlk.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_soft.c speakup: replace sprintf() by scnprintf() 2021-07-21 13:46:03 +02:00
speakup_spkout.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_txprt.c
speakupmap.h
speakupmap.map
spk_priv.h speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
spk_priv_keyinfo.h
spk_ttyio.c tty: fix possible null-ptr-defer in spk_ttyio_release 2023-01-24 07:22:46 +01:00
spk_types.h speakup: Make dectlk flush timeout configurable 2021-02-04 17:05:48 +01:00
synth.c speakup: Fix 8bit characters from direct synth 2024-04-10 16:18:40 +02:00
thread.c
varhandlers.c speakup: Make dectlk flush timeout configurable 2021-02-04 17:05:48 +01:00