Replace sprintf()->snprintf() and strcpy()->strlcpy()

The strcpy() and sprintf() functions are deprecated on some platforms.
Care is needed to ensure correct size is used.  If some platforms
miss snprintf, we can add a #define to sprintf, likewise strlcpy().

The biggest change is adding a size parameter to zfs_id_to_fuidstr().

The various *_impl_get() functions are only used on linux and have
not yet been updated.
This commit is contained in:
Jorgen Lundman
2020-06-08 03:42:12 +09:00
committed by Tony Hutter
parent 7b98b55282
commit 04837c8dcb
17 changed files with 66 additions and 50 deletions
+2 -2
View File
@@ -857,7 +857,7 @@ gcm_impl_init(void)
sizeof (gcm_fastest_impl));
}
strcpy(gcm_fastest_impl.name, "fastest");
strlcpy(gcm_fastest_impl.name, "fastest", GCM_IMPL_NAME_MAX);
#ifdef CAN_USE_GCM_ASM
/*
@@ -969,7 +969,7 @@ gcm_impl_set(const char *val)
return (err);
}
#if defined(_KERNEL)
#if defined(_KERNEL) && defined(__linux__)
#include <linux/mod_compat.h>
static int