diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2021-10-19 16:45:02 +0200 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2021-10-21 23:36:28 +0200 |
commit | afcb5a811ff3ab3969f09666535eb6018a160358 (patch) | |
tree | 2a6d3c09e4975adfa8ab343171a500f5eb9ff40b /security/yama | |
parent | ae53c6963f5a3dc89dd04fa1372910e442fabc14 (diff) |
auxdisplay: img-ascii-lcd: Fix lock-up when displaying empty string
While writing an empty string to a device attribute is a no-op, and thus
does not need explicit safeguards, the user can still write a single
newline to an attribute file:
echo > .../message
If that happens, img_ascii_lcd_display() trims the newline, yielding an
empty string, and causing an infinite loop in img_ascii_lcd_scroll().
Fix this by adding a check for empty strings. Clear the display in case
one is encountered.
Fixes: 0cad855fbd083ee5 ("auxdisplay: img-ascii-lcd: driver for simple ASCII LCD displays")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'security/yama')
0 files changed, 0 insertions, 0 deletions