]> git.baikalelectronics.ru Git - kernel.git/commit
net: use scnprintf() to avoid potential buffer overflow
authorChangli Gao <xiaosuo@gmail.com>
Tue, 24 Aug 2010 13:32:58 +0000 (13:32 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Aug 2010 21:11:49 +0000 (14:11 -0700)
commit96323c4b03ac207d25f72346588ed50548787a9b
tree71583203eb39de7ccf1733930833e9d229c38333
parent09df94b297797856a06ce6efdb2b659de67b4233
net: use scnprintf() to avoid potential buffer overflow

strlcpy() returns the total length of the string they tried to create, so
we should not use its return value without any check. scnprintf() returns
the number of characters written into @buf not including the trailing '\0',
so use it instead here.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethernet/eth.c