Commit cfdfdf9c authored by Sasha Levin's avatar Sasha Levin Committed by zhaoxiaoqiang11
Browse files

btrfs: replace strncpy() with strscpy()

stable inclusion
from stable-v5.10.163
commit 58de7a95f0e6c6da3f40fd0c49cfaf1cc06e21cc
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7PJ9N

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=58de7a95f0e6c6da3f40fd0c49cfaf1cc06e21cc



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

[ Upstream commit 63d5429f ]

Using strncpy() on NUL-terminated strings are deprecated.  To avoid
possible forming of non-terminated string strscpy() should be used.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

CC: stable@vger.kernel.org # 4.9+
Signed-off-by: default avatarArtem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
parent cac96202
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment