]> git.baikalelectronics.ru Git - kernel.git/commit
enic: change sprintf() to snprintf()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 17 Jan 2013 21:46:18 +0000 (21:46 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Jan 2013 19:34:48 +0000 (14:34 -0500)
commitd3c7b16590e6bc57454ae61db5e962c69fa8f3f9
treec24a2640af41309c22d32f21ab4332ec6d52ce9d
parenta4c66e5c31fdd3e20bf02a7764fec0a1a2e96bac
enic: change sprintf() to snprintf()

These are copying data into 16 char arrays.  They all specify that the
first string can't be more than 11 characters but once you add on the
"-rx-" and the NUL character there isn't space for the %d.

The first string is probably never going to be 11 characters, but if it
is then let's truncate the string instead of corrupting memory.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cisco/enic/enic_main.c