diff options
author | David Malone <dwmalone@FreeBSD.org> | 2001-05-03 11:26:46 +0000 |
---|---|---|
committer | David Malone <dwmalone@FreeBSD.org> | 2001-05-03 11:26:46 +0000 |
commit | d339edcf66f366e4a6a97e163b434f185e8013d0 (patch) | |
tree | 0a8eaf3f1ef1c7df90d03a078a7f966398bb3f86 /lib/libkvm | |
parent | 556a280696d39edd97cd03ed7c61d8c01d2ccd88 (diff) | |
download | src-d339edcf66f366e4a6a97e163b434f185e8013d0.tar.gz src-d339edcf66f366e4a6a97e163b434f185e8013d0.zip |
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).
Notes
Notes:
svn path=/head/; revision=76243
Diffstat (limited to 'lib/libkvm')
-rw-r--r-- | lib/libkvm/kvm_proc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index 96661c1b1759..d31392522abd 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -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; |