[libvirt] [PATCH] rpc: fix segmentation fault caused by null client-sock

Guannan Ren gren at redhat.com
Mon Aug 27 09:25:59 UTC 2012


On 08/27/2012 05:20 PM, Martin Kletzander wrote:
> On 08/27/2012 11:09 AM, Guannan Ren wrote:
>> BZ:https://bugzilla.redhat.com/show_bug.cgi?id=851423
>> The client-sock could have been set to NULL by eventloop thread
>> after async event fired.
>> ---
>>   src/rpc/virnetclient.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
>> index 4ecc703..43a9814 100644
>> --- a/src/rpc/virnetclient.c
>> +++ b/src/rpc/virnetclient.c
>> @@ -644,7 +644,8 @@ virNetClientMarkClose(virNetClientPtr client,
>>                         int reason)
>>   {
>>       VIR_DEBUG("client=%p, reason=%d", client, reason);
>> -    virNetSocketRemoveIOCallback(client->sock);
>> +    if (client->sock)
>> +        virNetSocketRemoveIOCallback(client->sock);
>>       client->wantClose = true;
>>       client->closeReason = reason;
>>   }
>>
> ACK,
>
> Martin

     Thanks Martin
     pushed.

     Guannan




More information about the libvir-list mailing list