mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-31 04:14:21 +03:00
Fix gcc uninitialized warning in FreeBSD zio_crypt.c
In FreeBSD's `zio_do_crypt_data()`, ensure that two `struct uio` variables are cleared before copying data out of them. This avoids accessing garbage data, and fixes gcc `-Wuninitialized` warnings. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Toomas Soome <tsoome@me.com> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Dimitry Andric <dimitry@andric.com> Closes #16688
This commit is contained in:
parent
82ab837a0e
commit
73b3e8acef
@ -1692,11 +1692,10 @@ zio_do_crypt_data(boolean_t encrypt, zio_crypt_key_t *key,
|
|||||||
freebsd_crypt_session_t *tmpl = NULL;
|
freebsd_crypt_session_t *tmpl = NULL;
|
||||||
uint8_t *authbuf = NULL;
|
uint8_t *authbuf = NULL;
|
||||||
|
|
||||||
|
memset(&puio_s, 0, sizeof (puio_s));
|
||||||
|
memset(&cuio_s, 0, sizeof (cuio_s));
|
||||||
zfs_uio_init(&puio, &puio_s);
|
zfs_uio_init(&puio, &puio_s);
|
||||||
zfs_uio_init(&cuio, &cuio_s);
|
zfs_uio_init(&cuio, &cuio_s);
|
||||||
memset(GET_UIO_STRUCT(&puio), 0, sizeof (struct uio));
|
|
||||||
memset(GET_UIO_STRUCT(&cuio), 0, sizeof (struct uio));
|
|
||||||
|
|
||||||
#ifdef FCRYPTO_DEBUG
|
#ifdef FCRYPTO_DEBUG
|
||||||
printf("%s(%s, %p, %p, %d, %p, %p, %u, %s, %p, %p, %p)\n",
|
printf("%s(%s, %p, %p, %d, %p, %p, %u, %s, %p, %p, %p)\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user