diff --git a/module/icp/algs/modes/gcm.c b/module/icp/algs/modes/gcm.c index 339ffb86f..71ea16d24 100644 --- a/module/icp/algs/modes/gcm.c +++ b/module/icp/algs/modes/gcm.c @@ -67,7 +67,9 @@ gcm_mode_encrypt_contiguous_blocks(gcm_ctx_t *ctx, char *data, size_t length, (uint8_t *)ctx->gcm_remainder + ctx->gcm_remainder_len, length); ctx->gcm_remainder_len += length; - ctx->gcm_copy_to = datap; + if (ctx->gcm_copy_to == NULL) { + ctx->gcm_copy_to = datap; + } return (CRYPTO_SUCCESS); }