fix operation on core files: cur_drive.io_name is an embedded array
in the structure we already fetched, not a pointer, so don't try to dereference its address as a kernel address.
This commit is contained in:
parent
6180e846ae
commit
ad0d9d79c0
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: drvstats.c,v 1.5 2009/01/18 07:20:00 lukem Exp $ */
|
/* $NetBSD: drvstats.c,v 1.6 2012/11/13 14:09:58 chs Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1996 John M. Vinopal
|
* Copyright (c) 1996 John M. Vinopal
|
||||||
@ -425,10 +425,8 @@ drvinit(int selected)
|
|||||||
} else {
|
} else {
|
||||||
p = iostathead;
|
p = iostathead;
|
||||||
for (i = 0; i < ndrive; i++) {
|
for (i = 0; i < ndrive; i++) {
|
||||||
char buf[10];
|
|
||||||
deref_kptr(p, &cur_drive, sizeof(cur_drive));
|
deref_kptr(p, &cur_drive, sizeof(cur_drive));
|
||||||
deref_kptr(cur_drive.io_name, buf, sizeof(buf));
|
cur.name[i] = strdup(cur_drive.io_name);
|
||||||
cur.name[i] = strdup(buf);
|
|
||||||
if (!cur.name[i])
|
if (!cur.name[i])
|
||||||
err(1, "strdup");
|
err(1, "strdup");
|
||||||
cur.select[i] = selected;
|
cur.select[i] = selected;
|
||||||
|
Loading…
Reference in New Issue
Block a user