Print this page
6638 ::pfiles walks out of bounds on array of vnode types
*** 526,536 ****
return (0);
}
const struct fs_type {
! int type;
const char *name;
} fs_types[] = {
{ VNON, "NON" },
{ VREG, "REG" },
{ VDIR, "DIR" },
--- 526,536 ----
return (0);
}
const struct fs_type {
! vtype_t type;
const char *name;
} fs_types[] = {
{ VNON, "NON" },
{ VREG, "REG" },
{ VDIR, "DIR" },
*** 945,957 ****
mdb_warn("failed to read vnode");
return (DCMD_ERR);
}
type = "?";
! for (i = 0; i <= NUM_FS_TYPES; i++) {
! if (fs_types[i].type == v.v_type)
type = fs_types[i].name;
}
do {
uintptr_t next_realvpp;
--- 945,959 ----
mdb_warn("failed to read vnode");
return (DCMD_ERR);
}
type = "?";
! for (i = 0; i < NUM_FS_TYPES; i++) {
! if (fs_types[i].type == v.v_type) {
type = fs_types[i].name;
+ break;
+ }
}
do {
uintptr_t next_realvpp;