Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e050778 authored by Herbert Xu's avatar Herbert Xu
Browse files

[CRYPTO] scatterwalk: Handle zero nbytes in scatterwalk_map_and_copy



It's better to return silently than crash and burn when someone feeds us
a zero length.  In particular the null digest algorithm when used as part
of authenc will do that to us.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent ce5bd4ac
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -105,6 +105,9 @@ void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg,
	struct scatter_walk walk;
	unsigned int offset = 0;

	if (!nbytes)
		return;

	for (;;) {
		scatterwalk_start(&walk, sg);