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

2019-07-12 Thread Brendan Shanks
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 w

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

2019-07-12 Thread Brendan Shanks
> On Jul 12, 2019, at 12:52 AM, Frediano Ziglio 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_progres

Re: [Spice-devel] [PATCH x11spice] Fix segfault when quitting with Quit button

2019-07-12 Thread Frediano Ziglio
> > Quitting with the Quit button or closing the window always causes a > segfault for me. Destroying the surface before removing the interface > seems to resolve the problem. > Acked. The surface surely was of the only display interface available. > log from valgrind: > ==7741== Invalid read o

[Spice-devel] [linux/vd-agent v1 4/7] x11-randr: use glib's MAX and MIN

2019-07-12 Thread Victor Toso
From: Victor Toso Since 2861868 "randr: remove monitors.xml on auto-configuration" in 2015-04-10 by Marc-Andre Lureau this file includes glib.h and can remove those helpers. Signed-off-by: Victor Toso --- src/vdagent/x11-randr.c | 18 -- 1 file changed, 4 insertions(+), 14 del

[Spice-devel] [linux/vd-agent v1 7/7] vdagent: simple fix for address-of-packed-member

2019-07-12 Thread Victor Toso
From: Victor Toso Seems to be a false positive but as this message only happens when user client connects, we can copy this array to make compiling warn free. > src/vdagent/vdagent.c: In function ‘daemon_read_complete’: > src/vdagent/vdagent.c:226:71: error: taking address of packed member of

[Spice-devel] [linux/vd-agent v1 6/7] x11-randr: simplest fix for address-of-packed-member

2019-07-12 Thread Victor Toso
From: Victor Toso The struct type for width/height is uint32_t while we are trying to access and change it with int* - code can be improved a bit in following patches but this one fixes the warning by copying the value from the struct and copying back new value afterwards. Also: - Moved variable

[Spice-devel] [linux/vd-agent v1 1/7] device-info: remove g_list_length() on compare_addresses()

2019-07-12 Thread Victor Toso
From: Victor Toso The g_list_length() function does iterate over both lists to compare its length. Considering that we use this to check for true/false and we will iterate again on both lists, we can do so once. This should also avoid covscan/clang warnings: | spice-vdagent-0.19.0/src/vdagent/

[Spice-devel] [linux/vd-agent v1 0/7] minor fixes

2019-07-12 Thread Victor Toso
From: Victor Toso Hi, Started this series some time ago and was laying low here. Realized that there are some address-of-packed-member warnings and decided to add to the end and send it. Cheers, Victor Toso (7): device-info: remove g_list_length() on compare_addresses() vdagent: fix memory

[Spice-devel] [linux/vd-agent v1 5/7] coverity: allow pass by value with XEvent

2019-07-12 Thread Victor Toso
From: Victor Toso Signed-off-by: Victor Toso --- src/vdagent/x11-randr.c | 4 ++-- src/vdagent/x11.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vdagent/x11-randr.c b/src/vdagent/x11-randr.c index d000e28..924f5ec 100644 --- a/src/vdagent/x11-randr.c +++ b/sr

[Spice-devel] [linux/vd-agent v1 2/7] vdagent: fix memory leak of g_memdup()

2019-07-12 Thread Victor Toso
From: Victor Toso Found by covscan: | spice-vdagent-0.19.0/src/vdagent/vdagent.c:432:9: warning: Potential leak of memory pointed to by 'orig_argv' | #g_printerr("Invalid arguments, %s\n", error->message); | #^ | spice-vdagent-0.19.0/src/vdagent/vdagent.c:418:24: note: Memor

[Spice-devel] [linux/vd-agent v1 3/7] covscan: check return value of fprintf

2019-07-12 Thread Victor Toso
From: Victor Toso | Error: CHECKED_RETURN (CWE-252): | spice-vdagent-0.19.0/src/vdagentd/vdagentd.c:999: check_return: Calling "fprintf" without checking return value (as is done elsewhere 29 out of 30 times). | spice-vdagent-0.19.0/src/vdagentd/xorg-conf.c:95: example_assign: Example 1: As

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

2019-07-12 Thread Frediano Ziglio
> > 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