Commit 68023e07 authored by Hao Chen's avatar Hao Chen Committed by Jiantao Xiao
Browse files

net: hns3: fix strncpy() not using dest-buf length as length issue

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7B8SA


CVE: NA

----------------------------------------------------------------------

Now, strncpy() in hns3_dbg_fill_content() use src-length as copy-length,
it may result in dest-buf overflow.

This patch add some values check to avoid this issue.

Fixes: 721091d1 ("net: hns3: refactor dump bd info of debugfs")
Signed-off-by: default avatarHao Chen <chenhao418@huawei.com>
parent 417e0f6b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment