Re: [virt-viewer][PATCH] Don't SIGSEGV if no transport is used.

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

 



On Wed, Nov 14, 2012 at 03:25:28PM +0100, Michal Privoznik wrote:
> One of previous commits (74b1b62510d939) allowed us to connect to
> localhost directly if ssh transport was used. However, if there's
> not transport, we SIGSEGV'ed as g_str_equal doesn't like NULL as

no transport

ACK

Christophe

> one of arguments. Change this to g_strcmp0 which does the same
> service but is more friendly to NULL arguments.
> ---
>  src/virt-viewer.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/virt-viewer.c b/src/virt-viewer.c
> index a0d530e..aedbf73 100644
> --- a/src/virt-viewer.c
> +++ b/src/virt-viewer.c
> @@ -376,7 +376,7 @@ virt_viewer_extract_connect_info(VirtViewer *self,
>       */
>      if (virt_viewer_replace_host(ghost)) {
>          gchar *replacement_host = NULL;
> -        if (g_str_equal(transport, "ssh")) {
> +        if (g_strcmp0(transport, "ssh") == 0) {
>              replacement_host = g_strdup("localhost");
>          } else {
>              replacement_host = g_strdup(host);
> -- 
> 1.7.8.6
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/virt-tools-list

Attachment: pgp_jieS8RrFH.pgp
Description: PGP signature


[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux