diff options
author | Wang Xiayang <xywang.sjtu@sjtu.edu.cn> | 2019-07-31 16:15:42 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-29 08:28:38 +0200 |
commit | d1ba0b81e70976ab8022aa5e1a1740c455f6fbfb (patch) | |
tree | 18857c542fd90b4733ce91d5befa261a9ec5b928 /fs | |
parent | 35d9e9211baf303037c3aae155428666b279d295 (diff) |
net/ethernet/qlogic/qed: force the string buffer NULL-terminated
[ Upstream commit 3690c8c9a8edff0db077a38783112d8fe12a7dd2 ]
strncpy() does not ensure NULL-termination when the input string
size equals to the destination buffer size 30.
The output string is passed to qed_int_deassertion_aeu_bit()
which calls DP_INFO() and relies NULL-termination.
Use strlcpy instead. The other conditional branch above strncpy()
needs no fix as snprintf() ensures NULL-termination.
This issue is identified by a Coccinelle script.
Signed-off-by: Wang Xiayang <xywang.sjtu@sjtu.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions