OSDN Git Service

soc: qcom: pdr: Prefer strscpy over strcpy
authorLen Baker <len.baker@gmx.com>
Sun, 8 Aug 2021 12:50:10 +0000 (14:50 +0200)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 21 Sep 2021 22:41:49 +0000 (17:41 -0500)
commit26bc7a6a0beed882032aa7c945e44d7e82887073
tree9c045e791c3e9445618a830ceddc88db86de812e
parentf69a91e376695ae6048934c92f6b7eea6c51cd86
soc: qcom: pdr: Prefer strscpy over strcpy

strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().

This is a previous step in the path to remove the strcpy() function
entirely from the kernel.

Signed-off-by: Len Baker <len.baker@gmx.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210808125012.4715-2-len.baker@gmx.com
drivers/soc/qcom/pdr_interface.c