mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
[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: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
ce5bd4aca3
commit
6e050778c5
@ -105,6 +105,9 @@ void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg,
|
|||||||
struct scatter_walk walk;
|
struct scatter_walk walk;
|
||||||
unsigned int offset = 0;
|
unsigned int offset = 0;
|
||||||
|
|
||||||
|
if (!nbytes)
|
||||||
|
return;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
scatterwalk_start(&walk, sg);
|
scatterwalk_start(&walk, sg);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user