Avoid dividing by zero if kd->procbase->ki_structsize is uninitalised.
(I'm testing the numerator rather than the denominator, which looks weird, but is the right thing to do here).
This commit is contained in:
parent
817448aa73
commit
775a137328
@ -413,7 +413,7 @@ kvm_getprocs(kd, op, arg, cnt)
|
||||
kd->procbase->ki_structsize);
|
||||
return (0);
|
||||
}
|
||||
nprocs = size / kd->procbase->ki_structsize;
|
||||
nprocs = size == 0 ? 0 : size / kd->procbase->ki_structsize;
|
||||
} else {
|
||||
struct nlist nl[4], *p;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user