]> git.proxmox.com Git - mirror_zfs.git/blobdiff - module/icp/core/kcf_prov_lib.c
Native Encryption for ZFS on Linux
[mirror_zfs.git] / module / icp / core / kcf_prov_lib.c
index dd4cd086d21f47ad7b62f9dd67833ea17cace69f..3cae872ddcf7116e1972ac303b0306ed2f11887f 100644 (file)
@@ -61,7 +61,7 @@ crypto_uio_data(crypto_data_t *data, uchar_t *buf, int len, cmd_type_t cmd,
            offset -= uiop->uio_iov[vec_idx++].iov_len)
                ;
 
-       if (vec_idx == uiop->uio_iovcnt) {
+       if (vec_idx == uiop->uio_iovcnt && length > 0) {
                /*
                 * The caller specified an offset that is larger than
                 * the total size of the buffers it provided.
@@ -192,7 +192,7 @@ crypto_update_uio(void *ctx, crypto_data_t *input, crypto_data_t *output,
            offset >= uiop->uio_iov[vec_idx].iov_len;
            offset -= uiop->uio_iov[vec_idx++].iov_len)
                ;
-       if (vec_idx == uiop->uio_iovcnt) {
+       if (vec_idx == uiop->uio_iovcnt && length > 0) {
                /*
                 * The caller specified an offset that is larger than the
                 * total size of the buffers it provided.