mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
qemuTestDriverInit: fill driver with zeroes
In the commit aea47e48c473a we have fixed a single pointer within driver structure. Since all callers pass statically allocated driver on stack other pointers within driver may contain random values too. Before touching it lets overwrite it with zeroes and thus fix all dangling pointers. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
9d7e20d119
commit
7f866e54df
@ -555,11 +555,11 @@ int qemuTestCapsCacheInsert(virQEMUCapsCachePtr cache, const char *binary,
|
||||
|
||||
int qemuTestDriverInit(virQEMUDriver *driver)
|
||||
{
|
||||
memset(driver, 0, sizeof(*driver));
|
||||
|
||||
if (virMutexInit(&driver->lock) < 0)
|
||||
return -1;
|
||||
|
||||
driver->securityManager = NULL;
|
||||
|
||||
driver->config = virQEMUDriverConfigNew(false);
|
||||
if (!driver->config)
|
||||
goto error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user