summaryrefslogtreecommitdiff
path: root/drivers/tty/vt
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-11-29 12:51:04 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-29 20:20:07 +0100
commit5020ded78348092eac5e9909018f6d53e24eadb6 (patch)
tree6c13f132c3788411b7a8efc2ea8e24f27dfbfa3c /drivers/tty/vt
parentf209fa03fc9d131b3108c2e4936181eabab87416 (diff)
tty: nozomi: avoid sprintf buffer overflow
Testing with a gcc-7 snapshot produced an internal compiler error for this file: drivers/tty/nozomi.c: In function 'receive_flow_control': drivers/tty/nozomi.c:919:12: internal compiler error: in get_substring_ranges_for_loc, at input.c:1388 static int receive_flow_control(struct nozomi *dc) I've reported this at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78569 but also noticed that the code line contains a stack overflow, as it prints a string into a slightly shorter fixed-length 'tmp' variable. A lot of the code here is unnecessary and can be expressed in a simpler way, relying on the fact that removing the 'DEBUG' macro will also get rid of all pr_debug() calls. This change should not change any of the output but avoids both the stack overflow and the gcc crash. The stack overflow will not happen unless a module load parameter is also set to enable the debug messages. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt')
0 files changed, 0 insertions, 0 deletions