summaryrefslogtreecommitdiff
path: root/net/sctp/sm_make_chunk.c
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 /net/sctp/sm_make_chunk.c
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 'net/sctp/sm_make_chunk.c')
0 files changed, 0 insertions, 0 deletions