Skip to content
Commit 8016c3da authored by Jan Kundrát's avatar Jan Kundrát Committed by Greg Kroah-Hartman
Browse files

tty: max310x: fix off-by-one buffer access when storing overrun



A recent change split the insertion loop into two parts. The first part
accessed bytes 0, 1, ... (rxlen - 2), and the second part by mistake
took offset `rxlen` instead of the correct `rxlen - 1`. So one byte was
not stored, and the final access wrote past the end of the rx_buf.

Fixes: 9c12d739 (tty: max310x: Split uart characters insertion loop)
Signed-off-by: default avatarJan Kundrát <jan.kundrat@cesnet.cz>
Reviewed-by: default avatarSerge Semin <fancer.lancer@gmail.com>
Link: https://lore.kernel.org/r/13ea227620aaad8a7231d42ed03a8508297d4eb3.1567027079.git.jan.kundrat@cesnet.cz


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 06e9b2fe
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment