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 c51bbc6e3298d43bb4932b6205efa915ab12e1ef..fe436a75a9fe01acd87a0386696294f10b6acc8a 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  {