linux-sg2042/drivers/net/ethernet/cavium
Arnd Bergmann 56c0da495a liquidio: fix possible eeprom format string overflow
gcc reports that the temporary buffer for computing the
string length may be too small here:

drivers/net/ethernet/cavium/liquidio/lio_ethtool.c: In function 'lio_get_eeprom_len':
/drivers/net/ethernet/cavium/liquidio/lio_ethtool.c:345:21: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
  len = sprintf(buf, "boardname:%s serialnum:%s maj:%lld min:%lld\n",
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/cavium/liquidio/lio_ethtool.c:345:6: note: 'sprintf' output between 35 and 167 bytes into a destination of size 128
  len = sprintf(buf, "boardname:%s serialnum:%s maj:%lld min:%lld\n",

This extends it to 192 bytes, which is certainly enough. As far
as I could tell, there are no other constraints that require a specific
maximum size.

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
..
liquidio liquidio: fix possible eeprom format string overflow 2017-07-14 09:03:11 -07:00
octeon net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL 2017-05-21 13:37:32 -04:00
thunder net: thunder_bgx: avoid format string overflow warning 2017-07-14 09:03:11 -07:00
Kconfig LiquidIO VF: s/select/imply/ for PTP_1588_CLOCK 2017-01-04 13:27:16 -05:00
Makefile netdev: Move octeon/octeon_mgmt driver to cavium directory. 2016-03-18 18:25:30 -04:00