mirror of
https://gitlab.com/virt-viewer/virt-viewer.git
synced 2025-08-24 17:49:22 +03:00
Avoid 'Dereference of a null pointer'
Caught by Covscan.
This commit is contained in:
@ -812,7 +812,7 @@ virt_viewer_auth_libvirt_credentials(virConnectCredentialPtr cred,
|
||||
VirtViewerWindow *vwin = virt_viewer_app_get_main_window(VIRT_VIEWER_APP(app));
|
||||
GtkWindow *win = virt_viewer_window_get_window(vwin);
|
||||
|
||||
if (*username == NULL || **username == '\0')
|
||||
if (username && (*username == NULL || **username == '\0'))
|
||||
*username = g_strdup(g_get_user_name());
|
||||
|
||||
priv->auth_cancelled = !virt_viewer_auth_collect_credentials(win,
|
||||
|
Reference in New Issue
Block a user