linux-stable/drivers/isdn
Arnd Bergmann 45e0b4b3d5 isdn: divert: fix sprintf buffer overflow warning
One string we pass into the cs->info buffer might be too long,
as pointed out by gcc:

drivers/isdn/divert/isdn_divert.c: In function 'll_callback':
drivers/isdn/divert/isdn_divert.c:488:22: error: '%d' directive writing between 1 and 3 bytes into a region of size between 1 and 69 [-Werror=format-overflow=]
 sprintf(cs->info, "%d 0x%lx %s %s %s %s 0x%x 0x%x %d %d %s\n",
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/isdn/divert/isdn_divert.c:488:22: note: directive argument in the range [0, 255]
drivers/isdn/divert/isdn_divert.c:488:4: note: 'sprintf' output 25 or more bytes (assuming 129) into a destination of size 90

This is unlikely to actually cause problems, so let's use snprintf
as a simple workaround to shut  up the warning and truncate the
buffer instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-07-14 09:03:11 -07:00
..
capi networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
divert isdn: divert: fix sprintf buffer overflow warning 2017-07-14 09:03:11 -07:00
gigaset net: introduce __skb_put_[zero, data, u8] 2017-06-20 13:30:14 -04:00
hardware networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hisax networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hysdn net: manual clean code which call skb_put_[data:zero] 2017-06-20 13:30:15 -04:00
i4l Merge branch 'work.misc-set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-05 13:13:32 -07:00
isdnloop Merge branch 'work.misc-set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-05 13:13:32 -07:00
mISDN net: convert sk_buff.users from atomic_t to refcount_t 2017-07-01 07:39:07 -07:00
Kconfig tty: Added a CONFIG_TTY option to allow removal of TTY 2013-01-18 16:15:27 -08:00
Makefile isdn: i4l: move active-isdn drivers to staging 2016-03-05 15:00:38 -08:00