posixshm: Report output buffer truncation from kern.ipc.posix_shm_list

PR:		240573
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33912
This commit is contained in:
Mark Johnston 2022-01-17 08:33:05 -05:00
parent ad15eeeaba
commit dc7526170d

View File

@ -2052,9 +2052,6 @@ sysctl_posix_shm_list(SYSCTL_HANDLER_ARGS)
if (error != 0)
break;
pack_kinfo(&kif);
if (req->oldptr != NULL &&
kif.kf_structsize + curlen > req->oldlen)
break;
error = sbuf_bcat(&sb, &kif, kif.kf_structsize) == 0 ?
0 : ENOMEM;
if (error != 0)