summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2016-01-22 22:26:03 -0500
committerRichard Lowe <richlowe@richlowe.net>2016-02-13 14:10:03 -0500
commit1665390b481087ca2aaff06a502c62b3ee91d530 (patch)
tree91f8c6c3279e25afc728c24badc75e072120c259 /usr/src/cmd
parentd456640d8a14f0ba35a7ec232f0ce9ebd34541cb (diff)
downloadillumos-joyent-1665390b481087ca2aaff06a502c62b3ee91d530.tar.gz
6638 ::pfiles walks out of bounds on array of vnode types
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/mdb/common/modules/genunix/vfs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr/src/cmd/mdb/common/modules/genunix/vfs.c b/usr/src/cmd/mdb/common/modules/genunix/vfs.c
index 3ea333ddf8..578f8ce6b1 100644
--- a/usr/src/cmd/mdb/common/modules/genunix/vfs.c
+++ b/usr/src/cmd/mdb/common/modules/genunix/vfs.c
@@ -528,7 +528,7 @@ pfiles_dig_pathname(uintptr_t vp, char *path)
}
const struct fs_type {
- int type;
+ vtype_t type;
const char *name;
} fs_types[] = {
{ VNON, "NON" },
@@ -947,9 +947,11 @@ pfile_callback(uintptr_t addr, const struct file *f, struct pfiles_cbdata *cb)
}
type = "?";
- for (i = 0; i <= NUM_FS_TYPES; i++) {
- if (fs_types[i].type == v.v_type)
+ for (i = 0; i < NUM_FS_TYPES; i++) {
+ if (fs_types[i].type == v.v_type) {
type = fs_types[i].name;
+ break;
+ }
}
do {