mirror of https://github.com/xzeldon/htop.git
Specify correct MIB length
Could have resulted in a buffer overflow if the FreeBSD kernel returned more bytes than expected.
This commit is contained in:
parent
402e46bb82
commit
92258e99e6
|
@ -121,7 +121,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui
|
||||||
len = sizeof(fpl->memZfsArc);
|
len = sizeof(fpl->memZfsArc);
|
||||||
if (sysctlbyname("kstat.zfs.misc.arcstats.size", &fpl->memZfsArc, &len,
|
if (sysctlbyname("kstat.zfs.misc.arcstats.size", &fpl->memZfsArc, &len,
|
||||||
NULL, 0) == 0 && fpl->memZfsArc != 0) {
|
NULL, 0) == 0 && fpl->memZfsArc != 0) {
|
||||||
sysctlnametomib("kstat.zfs.misc.arcstats.size", MIB_kstat_zfs_misc_arcstats_size, &len);
|
len = 5; sysctlnametomib("kstat.zfs.misc.arcstats.size", MIB_kstat_zfs_misc_arcstats_size, &len);
|
||||||
fpl->zfsArcEnabled = 1;
|
fpl->zfsArcEnabled = 1;
|
||||||
} else {
|
} else {
|
||||||
fpl->zfsArcEnabled = 0;
|
fpl->zfsArcEnabled = 0;
|
||||||
|
|
Loading…
Reference in New Issue