Skip to content

Commit

Permalink
knfsd: fix broken length check in nfs4idmap.c
Browse files Browse the repository at this point in the history
Obviously at some point we thought "error" represented the length when
positive.  This appears to be a long-standing typo.

Thanks to Prasad Potluri <[email protected]> for finding the problem and
proposing an earlier version of this patch.

Cc: Steve French <[email protected]>
Cc: Prasad V Potluri <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
J. Bruce Fields committed Feb 1, 2008
1 parent aefa89d commit d4395e0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions fs/nfsd/nfs4idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,10 @@ idtoname_parse(struct cache_detail *cd, char *buf, int buflen)
goto out;
if (len == 0)
set_bit(CACHE_NEGATIVE, &ent.h.flags);
else {
if (error >= IDMAP_NAMESZ) {
error = -EINVAL;
goto out;
}
else if (len >= IDMAP_NAMESZ)
goto out;
else
memcpy(ent.name, buf1, sizeof(ent.name));
}
error = -ENOMEM;
res = idtoname_update(&ent, res);
if (res == NULL)
Expand Down

0 comments on commit d4395e0

Please sign in to comment.