Re: [PATCH] qemuTestDriverInit: fill driver with zeroes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18.01.2016 10:22, Jiri Denemark wrote:
> On Mon, Jan 18, 2016 at 09:23:58 +0100, Michal Privoznik wrote:
>> 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@xxxxxxxxxx>
>> ---
>>  tests/testutilsqemu.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
>> index f2eacdd..6c52b96 100644
>> --- a/tests/testutilsqemu.c
>> +++ b/tests/testutilsqemu.c
>> @@ -558,7 +558,7 @@ int qemuTestDriverInit(virQEMUDriver *driver)
>>      if (virMutexInit(&driver->lock) < 0)
>>          return -1;
>>  
>> -    driver->securityManager = NULL;
>> +    memset(driver, 0, sizeof(*driver));
> 
> I'm afraid you just killed the just initialized mutex...
> 

Oh, you're right. Obviously I should not post any patches until morning
coffee has kicked in.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]