[Spice-devel] [PATCH x11spice] Fix hang when launching with invalid config

Brendan Shanks bshanks at codeweavers.com
Fri Jul 12 17:45:22 UTC 2019


> On Jul 12, 2019, at 12:52 AM, Frediano Ziglio <fziglio at redhat.com> wrote:
> 
>> 
>> When launching with no config file or arguments, the "You must provide
>> some authentication method" dialog appears. Clicking the Close button
>> would hang the application and it would never quit.
>> 
>> s->draw_command_in_progress was uninitialized, and flush_and_lock()
>> would get stuck in an infinite loop waiting for it to be 0.
>> 
>> Initialize s->draw_command_in_progress to 0.
>> 
>> Signed-off-by: Brendan Shanks <bshanks at codeweavers.com>
>> ---
>> src/session.c | 1 +
>> 1 file changed, 1 insertion(+)
>> 
>> diff --git a/src/session.c b/src/session.c
>> index 1e59415..c5a439c 100644
>> --- a/src/session.c
>> +++ b/src/session.c
>> @@ -306,6 +306,7 @@ int session_create(session_t *s)
>>     s->connected = FALSE;
>>     s->connect_pid = 0;
>>     s->disconnect_pid = 0;
>> +    s->draw_command_in_progress = 0;
> 
> Why not using FALSE instead?
> 
>> 
>>     if (s->options.audit)
>>         rc = begin_audit(s);
> 
> Maybe it would be also safe to initialize the "session" variable in main
> with a memset?
> 
> Frediano

Thank you, those are both good points. I’ll send an updated patch which just does an initial memset of ’session’.

Brendan



More information about the Spice-devel mailing list