Fix bug #3563 (URL parser will read out of bounds when closing bracket is missing...
authorColin Leroy <colin@colino.net>
Mon, 16 Nov 2015 09:04:16 +0000 (10:04 +0100)
committerColin Leroy <colin@colino.net>
Mon, 16 Nov 2015 09:04:16 +0000 (10:04 +0100)
Patch by Hanno Boeck

src/mainwindow.c

index c51bbc6..fe436a7 100644 (file)
@@ -3503,6 +3503,11 @@ static void get_url_part (const gchar **buffer, gchar *url_decoded)
                for (i = 0;
                     *buf != '>' && *buf != 0x00 && i < BUFFSIZE;
                        tmp[i++] = *(buf++));
+               if (*buf == 0) {
+                       *buffer = NULL;
+                       *url_decoded = '\0';
+                       return;
+               }
                buf++;
        }
        else  {