mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-16 23:57:54 +01:00
phkmalloc strikes again! :-) Another use of un-cleared returns from
malloc squashed...
This commit is contained in:
parent
77721f53be
commit
a52219bb33
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12683
@ -157,6 +157,7 @@ _kvm_malloc(kd, n)
|
||||
|
||||
if ((p = malloc(n)) == NULL)
|
||||
_kvm_err(kd, kd->program, strerror(errno));
|
||||
memset(p, 0, n);
|
||||
return (p);
|
||||
}
|
||||
|
||||
@ -275,6 +276,7 @@ kvm_openfiles(uf, mf, sf, flag, errout)
|
||||
(void)strcpy(errout, strerror(errno));
|
||||
return (0);
|
||||
}
|
||||
memset(kd, 0, sizeof(*kd));
|
||||
kd->program = 0;
|
||||
return (_kvm_open(kd, uf, mf, sf, flag, errout));
|
||||
}
|
||||
@ -295,6 +297,7 @@ kvm_open(uf, mf, sf, flag, errstr)
|
||||
errstr, strerror(errno));
|
||||
return (0);
|
||||
}
|
||||
memset(kd, 0, sizeof(*kd));
|
||||
kd->program = errstr;
|
||||
return (_kvm_open(kd, uf, mf, sf, flag, NULL));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user