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:
chs 2012-11-13 14:09:58 +00:00
parent 6180e846ae
commit ad0d9d79c0

View File

@ -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
@ -425,10 +425,8 @@ drvinit(int selected)
} else {
p = iostathead;
for (i = 0; i < ndrive; i++) {
char buf[10];
deref_kptr(p, &cur_drive, sizeof(cur_drive));
deref_kptr(cur_drive.io_name, buf, sizeof(buf));
cur.name[i] = strdup(buf);
cur.name[i] = strdup(cur_drive.io_name);
if (!cur.name[i])
err(1, "strdup");
cur.select[i] = selected;