[evolution-rss] Do not crash on illegal URIs



commit b2253df5a6d12f528d8d2cc03b38c90ba786e65a
Author: Fridrich Štrba <fridrich strba bluewin ch>
Date:   Thu Nov 20 10:25:55 2014 +0100

    Do not crash on illegal URIs
    
    For instance, the feed
      http://hg.openjdk.java.net/aarch64-port/jdk8/hotspot/atom-log
    produces article URIs like this one
      http:///aarch64-port/jdk8/hotspot/#changeset-<hash>

 src/misc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/misc.c b/src/misc.c
index 513f0b9..732a6c6 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -261,7 +261,7 @@ get_port_from_uri(gchar *uri)
        str = g_strsplit(uri, "://", 2);
        str2 = g_strsplit(str[1], "/", 2);
        str3 = g_strsplit(str2[0], ":", 2);
-       port = g_strdup(str3[1]);
+       port = *str3 ? g_strdup(str3[1]) : NULL;
        g_strfreev(str);
        g_strfreev(str2);
        g_strfreev(str3);


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