Re: [virt-viewer PATCH 4/5] Declare VirtViewerFile variable at start of method

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

 



On Wed, Feb 13, 2019 at 6:06 PM Daniel P. Berrangé <berrange@xxxxxxxxxx> wrote:
>
> virt_viewer_session_vnc_auth_credential uses gotos which jump over the
> declaration of 'file', meaning its contents are uninitialized in the
> jump target.
>
> Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>

Reviewed-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>


> ---
>  src/virt-viewer-session-vnc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/virt-viewer-session-vnc.c b/src/virt-viewer-session-vnc.c
> index e7c8cad..31d5361 100644
> --- a/src/virt-viewer-session-vnc.c
> +++ b/src/virt-viewer-session-vnc.c
> @@ -273,6 +273,7 @@ virt_viewer_session_vnc_auth_credential(GtkWidget *src G_GNUC_UNUSED,
>      VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
>      char *username = NULL, *password = NULL;
>      gboolean wantPassword = FALSE, wantUsername = FALSE;
> +    VirtViewerFile *file = NULL;
>      int i;
>
>      g_debug("Got VNC credential request for %u credential(s)", credList->n_values);
> @@ -295,7 +296,7 @@ virt_viewer_session_vnc_auth_credential(GtkWidget *src G_GNUC_UNUSED,
>          }
>      }
>
> -    VirtViewerFile *file = virt_viewer_session_get_file(VIRT_VIEWER_SESSION(self));
> +    file = virt_viewer_session_get_file(VIRT_VIEWER_SESSION(self));
>      if (file != NULL) {
>          if (wantUsername) {
>              if (virt_viewer_file_is_set(file, "username")) {
> --
> 2.20.1
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/virt-tools-list

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[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