[Spice-devel] [PATCH v2 spice-gtk 3/3] spice-session/spice_uri_parse: fail if trailing garbage in uri

Alon Levy alevy at redhat.com
Tue Jan 3 08:52:46 PST 2012


---
 gtk/spice-session.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 9ac543d..4a768c2 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -309,6 +309,11 @@ static int spice_uri_parse(SpiceSession *session, const char *original_uri)
         goto fail;
     }
 
+    if (uri[pos] != 0) {
+        g_warning("trailing garbage in uri");
+        goto fail;
+    }
+
     /* parsed ok -> apply */
     g_free(uri);
     g_free(s->host);
-- 
1.7.8.1



More information about the Spice-devel mailing list