diff options
author | 2006-10-02 12:01:40 +0000 | |
---|---|---|
committer | 2006-10-02 12:01:40 +0000 | |
commit | d64f797595c299483db8c88d7a38d366ef12c9d9 (patch) | |
tree | dbdf24c9ebace232848ce42458163b2a2a13b9b1 /lib/libutil | |
parent | get rid of a boolean typedef. this is c, we have ints, deal with it. (diff) | |
download | wireguard-openbsd-d64f797595c299483db8c88d7a38d366ef12c9d9.tar.xz wireguard-openbsd-d64f797595c299483db8c88d7a38d366ef12c9d9.zip |
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/libutil')
-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); |