mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 11:47:43 +03:00
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. Reviewed by: Sean Eric Fagan <sef@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Jorgen Lundman <lundman@lundman.net> Closes #10400
This commit is contained in:
+1
-1
@@ -253,7 +253,7 @@ void
|
||||
ddt_object_name(ddt_t *ddt, enum ddt_type type, enum ddt_class class,
|
||||
char *name)
|
||||
{
|
||||
(void) sprintf(name, DMU_POOL_DDT,
|
||||
(void) snprintf(name, DDT_NAMELEN, DMU_POOL_DDT,
|
||||
zio_checksum_table[ddt->ddt_checksum].ci_name,
|
||||
ddt_ops[type]->ddt_op_name, ddt_class_name[class]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user