提交 6e050778 编写于 作者: H Herbert Xu

[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: NHerbert Xu <herbert@gondor.apana.org.au>
上级 ce5bd4ac
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册