diff options
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 2ab8e5cb8f5..4e2c168b6ee 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -6086,11 +6086,11 @@ int nfs4_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry, | |||
6086 | __be32 *p = xdr_inline_decode(xdr, 4); | 6086 | __be32 *p = xdr_inline_decode(xdr, 4); |
6087 | if (unlikely(!p)) | 6087 | if (unlikely(!p)) |
6088 | goto out_overflow; | 6088 | goto out_overflow; |
6089 | if (!ntohl(*p++)) { | 6089 | if (*p == xdr_zero) { |
6090 | p = xdr_inline_decode(xdr, 4); | 6090 | p = xdr_inline_decode(xdr, 4); |
6091 | if (unlikely(!p)) | 6091 | if (unlikely(!p)) |
6092 | goto out_overflow; | 6092 | goto out_overflow; |
6093 | if (!ntohl(*p++)) | 6093 | if (*p == xdr_zero) |
6094 | return -EAGAIN; | 6094 | return -EAGAIN; |
6095 | entry->eof = 1; | 6095 | entry->eof = 1; |
6096 | return -EBADCOOKIE; | 6096 | return -EBADCOOKIE; |
@@ -6101,7 +6101,7 @@ int nfs4_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry, | |||
6101 | goto out_overflow; | 6101 | goto out_overflow; |
6102 | entry->prev_cookie = entry->cookie; | 6102 | entry->prev_cookie = entry->cookie; |
6103 | p = xdr_decode_hyper(p, &entry->cookie); | 6103 | p = xdr_decode_hyper(p, &entry->cookie); |
6104 | entry->len = ntohl(*p++); | 6104 | entry->len = be32_to_cpup(p); |
6105 | 6105 | ||
6106 | p = xdr_inline_decode(xdr, entry->len); | 6106 | p = xdr_inline_decode(xdr, entry->len); |
6107 | if (unlikely(!p)) | 6107 | if (unlikely(!p)) |
@@ -6132,9 +6132,6 @@ int nfs4_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry, | |||
6132 | if (entry->fattr->valid & NFS_ATTR_FATTR_TYPE) | 6132 | if (entry->fattr->valid & NFS_ATTR_FATTR_TYPE) |
6133 | entry->d_type = nfs_umode_to_dtype(entry->fattr->mode); | 6133 | entry->d_type = nfs_umode_to_dtype(entry->fattr->mode); |
6134 | 6134 | ||
6135 | if (verify_attr_len(xdr, p, len) < 0) | ||
6136 | goto out_overflow; | ||
6137 | |||
6138 | return 0; | 6135 | return 0; |
6139 | 6136 | ||
6140 | out_overflow: | 6137 | out_overflow: |