crypto: Advance the correct pointer in crypto_cursor_copydata()

PR:		271766
Reported by:	Michael Laß <bevan@bi-co.net>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40468
This commit is contained in:
Mark Johnston 2023-06-12 12:09:54 -04:00
parent 718d4a1d56
commit 9f7fdd8c1a

View file

@ -591,7 +591,7 @@ crypto_cursor_copydata(struct crypto_buffer_cursor *cc, int size, void *vdst)
remain = MIN(PAGE_SIZE - cc->cc_offset, cc->cc_buf_len);
todo = MIN(remain, size);
memcpy(dst, src, todo);
src += todo;
dst += todo;
cc->cc_buf_len -= todo;
if (todo < remain) {
cc->cc_offset += todo;