mirror of
https://gitlab.com/virt-viewer/virt-viewer.git
synced 2025-01-06 13:17:45 +03:00
Declare VirtViewerFile variable at start of method
virt_viewer_session_vnc_auth_credential uses gotos which jump over the declaration of 'file', meaning its contents are uninitialized in the jump target. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
9e4cc377a5
commit
5daeea567c
@ -273,6 +273,7 @@ virt_viewer_session_vnc_auth_credential(GtkWidget *src G_GNUC_UNUSED,
|
|||||||
VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
|
VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
|
||||||
char *username = NULL, *password = NULL;
|
char *username = NULL, *password = NULL;
|
||||||
gboolean wantPassword = FALSE, wantUsername = FALSE;
|
gboolean wantPassword = FALSE, wantUsername = FALSE;
|
||||||
|
VirtViewerFile *file = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
g_debug("Got VNC credential request for %u credential(s)", credList->n_values);
|
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 (file != NULL) {
|
||||||
if (wantUsername) {
|
if (wantUsername) {
|
||||||
if (virt_viewer_file_is_set(file, "username")) {
|
if (virt_viewer_file_is_set(file, "username")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user