Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=67f97d83bfcca9d9f8fbeeb14e7c644a82b24e12
Commit:     67f97d83bfcca9d9f8fbeeb14e7c644a82b24e12
Parent:     afde94f398b62c8596a8d0cbfc25798f0b52a371
Author:     Chuck Lever <[EMAIL PROTECTED]>
AuthorDate: Wed Sep 26 14:38:10 2007 -0400
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 17:20:30 2007 -0400

    SUNRPC: Use correct type in buffer length calculations
    
    Use correct type signage in gss_krb5_remove_padding() when doing length
    calculations.  Both xdr_buf.len and iov.iov_len are size_t, which is
    unsigned; so use an unsigned type for our temporary length variable to
    ensure we don't overflow it..
    
    Signed-off-by: Chuck Lever <[EMAIL PROTECTED]>
    Signed-off-by: "J. Bruce Fields" <[EMAIL PROTECTED]>
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
---
 net/sunrpc/auth_gss/gss_krb5_wrap.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c 
b/net/sunrpc/auth_gss/gss_krb5_wrap.c
index 42b3220..8bd074d 100644
--- a/net/sunrpc/auth_gss/gss_krb5_wrap.c
+++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c
@@ -42,7 +42,7 @@ gss_krb5_remove_padding(struct xdr_buf *buf, int blocksize)
 {
        u8 *ptr;
        u8 pad;
-       int len = buf->len;
+       size_t len = buf->len;
 
        if (len <= buf->head[0].iov_len) {
                pad = *(u8 *)(buf->head[0].iov_base + len - 1);
@@ -53,9 +53,9 @@ gss_krb5_remove_padding(struct xdr_buf *buf, int blocksize)
        } else
                len -= buf->head[0].iov_len;
        if (len <= buf->page_len) {
-               int last = (buf->page_base + len - 1)
+               unsigned int last = (buf->page_base + len - 1)
                                        >>PAGE_CACHE_SHIFT;
-               int offset = (buf->page_base + len - 1)
+               unsigned int offset = (buf->page_base + len - 1)
                                        & (PAGE_CACHE_SIZE - 1);
                ptr = kmap_atomic(buf->pages[last], KM_USER0);
                pad = *(ptr + offset);
-
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