Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=745542e210b3b15751ea9d511321924ac36b85db
Commit:     745542e210b3b15751ea9d511321924ac36b85db
Parent:     7505e0525c914cdfdb54f43a7e70f038a16a5486
Author:     Jeff Layton <[EMAIL PROTECTED]>
AuthorDate: Sat Nov 3 04:34:04 2007 +0000
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Sat Nov 3 04:34:04 2007 +0000

    [CIFS] allow cifs_calc_signature2 to deal with a zero length iovec
    
    Currently, cifs_calc_signature2 errors out if it gets a zero-length
    iovec. Fix it to silently continue in that case.
    
    Signed-off-by: Jeff Layton <[EMAIL PROTECTED]>
    Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/cifsencrypt.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index 632070b..788f0ad 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -99,11 +99,12 @@ static int cifs_calc_signature2(const struct kvec *iov, int 
n_vec,
        MD5Init(&context);
        MD5Update(&context, (char *)&key->data, key->len);
        for (i = 0; i < n_vec; i++) {
+               if (iov[i].iov_len == 0)
+                       continue;
                if (iov[i].iov_base == NULL) {
                        cERROR(1, ("null iovec entry"));
                        return -EIO;
-               } else if (iov[i].iov_len == 0)
-                       break; /* bail out if we are sent nothing to sign */
+               }
                /* The first entry includes a length field (which does not get
                   signed that occupies the first 4 bytes before the header */
                if (i == 0) {
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to