platform/x86: hp-bioscfg: Replace deprecated strncpy() with strscpy()
Subsystems (2)
PATCH 1/1 platform/x86: hp-bioscfg: Replace deprecated strncpy() with strscpy()
Since kstrtol() requires a NUL-terminated string as input and strncpy() is deprecated for NUL-terminated destination buffers, use strscpy() instead.
Compile-tested only.
--- drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +1 -1
@@ -448,7 +448,7 @@ int hp_convert_hexstr_to_str(const char *input, u32 input_len, char **str, int *return -ENOMEM ;for (i =0 ; i < input_len; i +=5 ) { -strncpy (tmp, input + i,strlen (tmp)); +strscpy (tmp, input + i);if (kstrtol (tmp,16 , &ch) ==0 ) {// escape char if (ch == '\\' ||
Signature · 1 line
2.48.1
Ilpo Järvinen
maintainerQuoted 8 lines · Thorsten Blum
Since
kstrtol()requires a NUL-terminated string as input andstrncpy()is deprecated for NUL-terminated destination buffers, usestrscpy()instead.Compile-tested only.
[...]
Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.
The list of commits applied:
[1/1] platform/x86: hp-bioscfg: Replace deprecated strncpy() with strscpy()
commit: baa18b6ed4200aff869e78f2650123572b6a9ad6
--
i.