Commit 9d32c0cd authored by Samuel Thibault's avatar Samuel Thibault Committed by Greg Kroah-Hartman

staging/speakup: fix get_word non-space look-ahead

get_char was erroneously given the address of the pointer to the text
instead of the address of the text, thus leading to random crashes when
the user requests speaking a word while the current position is on a space
character and say_word_ctl is not enabled.

Reported-on: https://github.com/bytefire/speakup/issues/1Reported-by: default avatarKirk Reiser <kirk@reisers.ca>
Reported-by: default avatarJanina Sajka <janina@rednote.net>
Reported-by: default avatarAlexandr Epaneshnikov <aarnaarn2@gmail.com>
Reported-by: default avatarGregory Nowak <greg@gregn.net>
Reported-by: default avatardeedra waters <deedra@the-brannons.com>
Signed-off-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
Tested-by: default avatarAlexandr Epaneshnikov <aarnaarn2@gmail.com>
Tested-by: default avatarGregory Nowak <greg@gregn.net>
Tested-by: default avatarMichael Taboada <michael@michaels.world>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200306003047.thijtmqrnayd3dmw@functionSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f8788d86
...@@ -561,7 +561,7 @@ static u_long get_word(struct vc_data *vc) ...@@ -561,7 +561,7 @@ static u_long get_word(struct vc_data *vc)
return 0; return 0;
} else if (tmpx < vc->vc_cols - 2 && } else if (tmpx < vc->vc_cols - 2 &&
(ch == SPACE || ch == 0 || (ch < 0x100 && IS_WDLM(ch))) && (ch == SPACE || ch == 0 || (ch < 0x100 && IS_WDLM(ch))) &&
get_char(vc, (u_short *)&tmp_pos + 1, &temp) > SPACE) { get_char(vc, (u_short *)tmp_pos + 1, &temp) > SPACE) {
tmp_pos += 2; tmp_pos += 2;
tmpx++; tmpx++;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment