Commit:     6e050778c5d08a97d5d98f7cb62bc503e872615c
Parent:     ce5bd4aca3c467936370846119b7f3daf9ccea78
Author:     Herbert Xu <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 14 00:44:11 2007 +0800
Committer:  Herbert Xu <[EMAIL PROTECTED]>
CommitDate: Fri Jan 11 08:16:54 2008 +1100

    [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 <[EMAIL PROTECTED]>
 crypto/scatterwalk.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c
index 297e19d..9aeeb52 100644
--- a/crypto/scatterwalk.c
+++ b/crypto/scatterwalk.c
@@ -105,6 +105,9 @@ void scatterwalk_map_and_copy(void *buf, struct scatterlist 
        struct scatter_walk walk;
        unsigned int offset = 0;
+       if (!nbytes)
+               return;
        for (;;) {
                scatterwalk_start(&walk, sg);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to