mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 22:15:20 +00:00
apparmor: Fix use of uninitialized random_data
Without this, virt-aa-helper would segfault in -c or -r commands.
This commit is contained in:
parent
98b01e8f2b
commit
bc1edeb611
@ -42,6 +42,7 @@
|
|||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "configmake.h"
|
#include "configmake.h"
|
||||||
|
#include "virrandom.h"
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_SECURITY
|
#define VIR_FROM_THIS VIR_FROM_SECURITY
|
||||||
|
|
||||||
@ -1182,6 +1183,9 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
memset(ctl, 0, sizeof(vahControl));
|
memset(ctl, 0, sizeof(vahControl));
|
||||||
|
|
||||||
|
if (virRandomInitialize(time(NULL) ^ getpid()) < 0)
|
||||||
|
vah_error(ctl, 1, _("could not initialize random generator"));
|
||||||
|
|
||||||
if (vahParseArgv(ctl, argc, argv) != 0)
|
if (vahParseArgv(ctl, argc, argv) != 0)
|
||||||
vah_error(ctl, 1, _("could not parse arguments"));
|
vah_error(ctl, 1, _("could not parse arguments"));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user