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:
parent
556a280696
commit
d339edcf66
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=76243
@ -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