Skip to content

Commit 6551198

Browse files
AdrianBunkLinus Torvalds
authored andcommitted
fs/afs/vlocation.c: fix off-by-one
This patch fixes an off-by-one error spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent f11b7ae commit 6551198

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/afs/vlocation.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ struct afs_vlocation *afs_vlocation_lookup(struct afs_cell *cell,
382382
cell->name, key_serial(key),
383383
(int) namesz, (int) namesz, name, namesz);
384384

385-
if (namesz > sizeof(vl->vldb.name)) {
385+
if (namesz >= sizeof(vl->vldb.name)) {
386386
_leave(" = -ENAMETOOLONG");
387387
return ERR_PTR(-ENAMETOOLONG);
388388
}

0 commit comments

Comments
 (0)