1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-05 09:14:03 +00:00

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:
David Malone 2001-05-03 11:26:46 +00:00
parent 556a280696
commit d339edcf66
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=76243

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;