mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
bhyve: Don't stack-allocate huge error buffers
_POSIX2_LINE_MAX is 2048. Allocate the buffers on the heap instead. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
This commit is contained in:
parent
8d76c9390e
commit
194c75f458
@ -380,7 +380,7 @@ virBhyveGetDomainTotalCpuStats(virDomainObj *vm,
|
||||
{
|
||||
struct kinfo_proc *kp;
|
||||
kvm_t *kd;
|
||||
char errbuf[_POSIX2_LINE_MAX];
|
||||
g_autofree char *errbuf = g_new0(char, _POSIX2_LINE_MAX);
|
||||
int nprocs;
|
||||
int ret = -1;
|
||||
|
||||
@ -481,7 +481,7 @@ virBhyveProcessReconnectAll(struct _bhyveConn *driver)
|
||||
{
|
||||
kvm_t *kd;
|
||||
struct bhyveProcessReconnectData data;
|
||||
char errbuf[_POSIX2_LINE_MAX];
|
||||
g_autofree char *errbuf = g_new0(char, _POSIX2_LINE_MAX);
|
||||
|
||||
if ((kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf)) == NULL) {
|
||||
virReportError(VIR_ERR_SYSTEM_ERROR,
|
||||
|
Loading…
Reference in New Issue
Block a user