aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gcc-plugins/randomize_layout_plugin.c
diff options
context:
space:
mode:
authorJustin Stitt <[email protected]>2023-09-26 06:59:15 +0000
committerKees Cook <[email protected]>2023-10-24 21:10:53 +0000
commit9cca73d7b4bfec75b2fcef751015f31691afa792 (patch)
tree2e0641bb71e0c56cd74b87c4f448257dfc77698e /scripts/gcc-plugins/randomize_layout_plugin.c
parentreset: Annotate struct reset_control_array with __counted_by (diff)
downloadkernel-9cca73d7b4bfec75b2fcef751015f31691afa792.tar.gz
kernel-9cca73d7b4bfec75b2fcef751015f31691afa792.zip
hwmon: (acpi_power_meter) replace open-coded kmemdup_nul
`strncpy` is deprecated for use on NUL-terminated destination strings [1]. Let's refactor this kcalloc() + strncpy() into a kmemdup_nul() which has more obvious behavior and is less error prone. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: [email protected] Signed-off-by: Justin Stitt <[email protected]> Reviewed-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/20230926-strncpy-drivers-hwmon-acpi_power_meter-c-v5-1-3fc31a9daf99@google.com Signed-off-by: Kees Cook <[email protected]>
Diffstat (limited to 'scripts/gcc-plugins/randomize_layout_plugin.c')
0 files changed, 0 insertions, 0 deletions