libprocstat: make sv_name not static

Making this variable static makes is_elf32_sysctl() and callers thread
unsafe.

Use a less absurd length for sv_name.  The longest name in the system is
"FreeBSD ELF64 V2" which tips the scales at 16+1 bytes.  We'll almost
certainly have other problems if we exceed 32 characters.

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D42199

(cherry picked from commit 72a4ee26a7c665ae1c31abe1c6feeaa7ccaba140)
This commit is contained in:
Brooks Davis 2023-10-16 17:53:11 +01:00
parent d65a002ded
commit 9b48cb8e89

View file

@ -2392,7 +2392,7 @@ is_elf32_sysctl(pid_t pid)
{
int error, name[4];
size_t len, i;
static char sv_name[256];
char sv_name[32];
name[0] = CTL_KERN;
name[1] = KERN_PROC;