diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2006-10-02 12:01:41 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2006-10-02 12:01:41 +0000 |
commit | a7583d5e274608fc59de9d0a30f43dde1ef34df5 (patch) | |
tree | a9c056acf5a1e27efd21c8f65e665ee522c63413 /lib | |
parent | 5d3cbc62a7d3dda902d3fde415fa32ac040f3206 (diff) |
Fix off by one comparison. FSMAXTYPES is the last valid index into
fstypesnames[], but that entry is NULL. The last valid file system
name is at fstypesnames[FSMAXTYPES-1].
Encountered and diagnosed by pedro@.
ok pedro@ deraadt@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libutil/readlabel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libutil/readlabel.c b/lib/libutil/readlabel.c index 6044574967f..acb3699c48d 100644 --- a/lib/libutil/readlabel.c +++ b/lib/libutil/readlabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readlabel.c,v 1.9 2004/09/18 19:24:14 deraadt Exp $ */ +/* $OpenBSD: readlabel.c,v 1.10 2006/10/02 12:01:40 krw Exp $ */ /* * Copyright (c) 1996, Jason Downs. All rights reserved. @@ -113,7 +113,7 @@ readlabelfs(char *device, int verbose) } close(fd); - if (dk.d_partitions[part - 'a'].p_fstype > FSMAXTYPES) { + if (dk.d_partitions[part - 'a'].p_fstype >= FSMAXTYPES) { if (verbose) warnx("%s: bad filesystem type in label", rpath); return (NULL); |