]> git.hungrycats.org Git - linux/commitdiff
[PATCH] CIFSSMBQueryReparseLinkInfo() endianness fix
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Sat, 11 Sep 2004 10:16:16 +0000 (03:16 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 11 Sep 2004 10:16:16 +0000 (03:16 -0700)
le16_to_cpu() on 32bit field.

Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/cifs/cifssmb.c

index f0fa1406c21b11a40dc198af0c97153222c29ab0..e936f1f06675cf4b3d456c1e9eb59c968fdf444d 100644 (file)
@@ -1508,16 +1508,16 @@ CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
        if (rc) {
                cFYI(1, ("Send error in QueryReparseLinkInfo = %d", rc));
        } else {                /* decode response */
-               pSMBr->DataOffset = le16_to_cpu(pSMBr->DataOffset);
-               pSMBr->DataCount = le16_to_cpu(pSMBr->DataCount);
-               if ((pSMBr->ByteCount < 2) || (pSMBr->DataOffset > 512))
+               __u32 data_offset = le32_to_cpu(pSMBr->DataOffset);
+               __u32 data_count = le32_to_cpu(pSMBr->DataCount);
+               if ((pSMBr->ByteCount < 2) || (data_offset > 512))
                /* BB also check enough total bytes returned */
                        rc = -EIO;      /* bad smb */
                else {
-                       if(pSMBr->DataCount && (pSMBr->DataCount < 2048)) {
+                       if(data_count && (data_count < 2048)) {
                /* could also validate reparse tag && better check name length */
                                struct reparse_data * reparse_buf = (struct reparse_data *)
-                                       ((char *)&pSMBr->hdr.Protocol + pSMBr->DataOffset);
+                                       ((char *)&pSMBr->hdr.Protocol + data_offset);
                                if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE) {
                                        name_len = UniStrnlen((wchar_t *)
                                                        (reparse_buf->LinkNamesBuf +