[spice-gtk v1 1/2] channel-webdav: avoid possible crash

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

 



From: Victor Toso <me@xxxxxxxxxxxxxx>

In case PhodavServer or SoupServer are NULL, we should stop and
return.

Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
---
 src/channel-webdav.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/channel-webdav.c b/src/channel-webdav.c
index 8e4db1a..195ae34 100644
--- a/src/channel-webdav.c
+++ b/src/channel-webdav.c
@@ -355,12 +355,17 @@ static void start_client(SpiceWebdavChannel *self)
     GIOStream *peer = NULL;
     SpiceSession *session;
     SoupServer *server;
+    PhodavServer* phodav_server;
     GSocketAddress *addr;
     GError *error = NULL;
     bool started;
 
     session = spice_channel_get_session(SPICE_CHANNEL(self));
-    server = phodav_server_get_soup_server(spice_session_get_webdav_server(session));
+    phodav_server = spice_session_get_webdav_server(session);
+    g_return_if_fail(phodav_server != NULL);
+
+    server = phodav_server_get_soup_server(phodav_server);
+    g_return_if_fail(server != NULL);
 
     CHANNEL_DEBUG(self, "starting client %" G_GINT64_FORMAT, c->demux.client);
 
-- 
2.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]