diff options
author | Ondrej Holy <oholy@redhat.com> | 2016-06-28 16:07:03 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2016-06-28 16:44:29 +0200 |
commit | 4dca9bcd306e16b60b6577734951027cf85081e7 (patch) | |
tree | 2e4a4dce89f77807a31aedac952dcb122728a4a5 | |
parent | d965154461d84a1d1763a813db82747377a7e07f (diff) | |
download | gvfs-4dca9bcd306e16b60b6577734951027cf85081e7.tar.gz |
daemon: Handle NULL certificates properly
Webdav backend crashes if libsoup returns NULL certificate. Ftp backend
may be also affected. The crash may happen if you try to connect with
"davs://" ("ftps://") to a server, which is not TLS-enabled. The backend
fails properly with libsoup error thanks to this patch.
https://bugzilla.redhat.com/show_bug.cgi?id=1350820
-rw-r--r-- | daemon/gvfsdaemonutils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/daemon/gvfsdaemonutils.c b/daemon/gvfsdaemonutils.c index 49999a8a..77c7b1b4 100644 --- a/daemon/gvfsdaemonutils.c +++ b/daemon/gvfsdaemonutils.c @@ -333,6 +333,9 @@ gvfs_accept_certificate (GMountSource *mount_source, gboolean handled, aborted = FALSE; char *certificate_str, *reason, *message; + if (certificate == NULL) + return FALSE; + certificate_str = certificate_to_string (certificate); reason = certificate_flags_to_string (errors); message = g_strdup_printf (_("The site's identity can't be verified:" |