Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Oct 2023 16:59:20 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 8f06fabe39ac - main - libprocstat: copy all the 32-bit auxv entries
Message-ID:  <202310161659.39GGxK01028911@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=8f06fabe39ac3ebca4ab448a456945008305a23f

commit 8f06fabe39ac3ebca4ab448a456945008305a23f
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-10-16 16:53:22 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-10-16 16:58:43 +0000

    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
---
 lib/libprocstat/libprocstat.c | 4 ++--
 1 file 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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202310161659.39GGxK01028911>