aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2007-10-26 13:32:50 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-02-01 16:42:01 -0500
commitd4395e03fec0895d01451904b8a2276ceda663c9 (patch)
treeb4dd510ce3aa21a8f055d189e77b8047d162fa2d
parentaefa89d178e6dd83889b66d4e800d4d77363900b (diff)
knfsd: fix broken length check in nfs4idmap.c
Obviously at some point we thought "error" represented the length when positive. This appears to be a long-standing typo. Thanks to Prasad Potluri <pvp@us.ibm.com> for finding the problem and proposing an earlier version of this patch. Cc: Steve French <smfltc@us.ibm.com> Cc: Prasad V Potluri <pvp@us.ibm.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
-rw-r--r--fs/nfsd/nfs4idmap.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index 4c0c683ce07a..5b56c77c15c5 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -255,13 +255,10 @@ idtoname_parse(struct cache_detail *cd, char *buf, int buflen)
255 goto out; 255 goto out;
256 if (len == 0) 256 if (len == 0)
257 set_bit(CACHE_NEGATIVE, &ent.h.flags); 257 set_bit(CACHE_NEGATIVE, &ent.h.flags);
258 else { 258 else if (len >= IDMAP_NAMESZ)
259 if (error >= IDMAP_NAMESZ) { 259 goto out;
260 error = -EINVAL; 260 else
261 goto out;
262 }
263 memcpy(ent.name, buf1, sizeof(ent.name)); 261 memcpy(ent.name, buf1, sizeof(ent.name));
264 }
265 error = -ENOMEM; 262 error = -ENOMEM;
266 res = idtoname_update(&ent, res); 263 res = idtoname_update(&ent, res);
267 if (res == NULL) 264 if (res == NULL)