]> git.baikalelectronics.ru Git - kernel.git/commit
qed: Fix copying 2 strings
authorDenis Bolotin <denis.bolotin@cavium.com>
Tue, 24 Apr 2018 12:32:53 +0000 (15:32 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Apr 2018 17:59:42 +0000 (13:59 -0400)
commit983e43ab9bee6c6a0394416a5fa4efc395b99db9
tree0b310d0fbb60f8bee14ff5c307ec6bc5f7e71f80
parent28d98aa9c430da8a6c693951ccd8e27e0d9ac0d0
qed: Fix copying 2 strings

The strscpy() was a recent fix (net: qed: use correct strncpy() size) to
prevent passing the length of the source buffer to strncpy() and guarantee
null termination.
It misses the goal of overwriting only the first 3 characters in
"???_BIG_RAM" and "???_RAM" while keeping the rest of the string.
Use strncpy() with the length of 3, without null termination.

Signed-off-by: Denis Bolotin <denis.bolotin@cavium.com>
Signed-off-by: Ariel Elior <ariel.elior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_debug.c