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:
dwmalone 2001-05-03 11:26:46 +00:00
parent 817448aa73
commit 775a137328

View File

@ -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;