diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2023-10-16 16:53:22 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2023-10-25 23:30:56 +0000 |
commit | ff90744045e310acae79669c07f70f0ecb5fbc0a (patch) | |
tree | 3743eaee7747f05a5952851cecaf006f93e305f4 | |
parent | 9b48cb8e89c86128c1d9d89eea67ef4b28a38c52 (diff) | |
download | src-ff90744045e310acae79669c07f70f0ecb5fbc0a.tar.gz src-ff90744045e310acae79669c07f70f0ecb5fbc0a.zip |
libprocstat: copy all the 32-bit auxv entries
Use source struct size not the destination struct size so we copy all
the auxv entries, not just the first half of them.
Fix a style issue on an adjacent line.
Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42200
(cherry picked from commit 8f06fabe39ac3ebca4ab448a456945008305a23f)
-rw-r--r-- | lib/libprocstat/libprocstat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c index 84502bb895b7..031294387ca7 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -2434,8 +2434,8 @@ procstat_getauxv32_sysctl(pid_t pid, unsigned int *cntp) warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); goto out; } - count = len / sizeof(Elf_Auxinfo); - auxv = malloc(count * sizeof(Elf_Auxinfo)); + count = len / sizeof(Elf32_Auxinfo); + auxv = malloc(count * sizeof(Elf_Auxinfo)); if (auxv == NULL) { warn("malloc(%zu)", count * sizeof(Elf_Auxinfo)); goto out; |