2006-05-17 [wwp] 2.2.0cvs26
authorTristan Chabredier <wwp@claws-mail.org>
Wed, 17 May 2006 09:28:12 +0000 (09:28 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Wed, 17 May 2006 09:28:12 +0000 (09:28 +0000)
* src/mainwindow.c
fix useless and potentially dangerous buffer walking (thanks to Colin).

ChangeLog
PATCHSETS
configure.ac
src/mainwindow.c

index c0bc1b855a4280a869af23853efbc6a468dfbdef..57ba8d1b47138c8e872ab8a49f794d5f94fddff9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-17 [wwp]       2.2.0cvs26
+
+       * src/mainwindow.c
+               fix useless and potentially dangerous buffer walking (thanks to Colin).
+
 2006-05-17 [wwp]       2.2.0cvs25
 
        * src/plugins/demo/demo.c
 2006-05-17 [wwp]       2.2.0cvs25
 
        * src/plugins/demo/demo.c
index 37fdd11d131db399b8c9e7f55d1572ab3b9c58a6..d02c37919682baa56cad46901f3b83a4e1c1c21b 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.274.2.112 -r 1.274.2.114 src/mainwindow.c;  ) > 2.2.0cvs23.patchset
 ( cvs diff -u -r 1.79.2.26 -r 1.79.2.27 src/mh.c;  ) > 2.2.0cvs24.patchset
 ( cvs diff -u -r 1.13.2.6 -r 1.13.2.7 src/plugins/demo/demo.c;  ) > 2.2.0cvs25.patchset
 ( cvs diff -u -r 1.274.2.112 -r 1.274.2.114 src/mainwindow.c;  ) > 2.2.0cvs23.patchset
 ( cvs diff -u -r 1.79.2.26 -r 1.79.2.27 src/mh.c;  ) > 2.2.0cvs24.patchset
 ( cvs diff -u -r 1.13.2.6 -r 1.13.2.7 src/plugins/demo/demo.c;  ) > 2.2.0cvs25.patchset
+( cvs diff -u -r 1.274.2.114 -r 1.274.2.115 src/mainwindow.c;  ) > 2.2.0cvs26.patchset
index ef88c6dc2cb98764354ef79336c395e56ea2d5ce..feaf124b9fa552ef1602d0a03663ea5914855c48 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=2
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=25
+EXTRA_VERSION=26
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 46192263347debfde01809506193f81c968882d3..c76e225501bf1f7c5f03c437d74e1656553f93f9 100644 (file)
@@ -2366,7 +2366,8 @@ static void get_url_part (const gchar **buffer, gchar *url_decoded, gint maxlen)
        buf = *buffer;
        
        if (buf == 0x00) {
        buf = *buffer;
        
        if (buf == 0x00) {
-               url_decoded = 0x00;
+               url_decoded = NULL;
+               *buffer = NULL;
                return;
        }
        /* Ignore spaces, comments  and tabs () */
                return;
        }
        /* Ignore spaces, comments  and tabs () */
@@ -2380,15 +2381,17 @@ static void get_url_part (const gchar **buffer, gchar *url_decoded, gint maxlen)
                for (i = 0; *buf != '>' && *buf != 0x00 && i<maxlen; tmp[i++] = *(buf++));
                buf++;
        }
                for (i = 0; *buf != '>' && *buf != 0x00 && i<maxlen; tmp[i++] = *(buf++));
                buf++;
        }
-       else 
-               /* else, we finish parsing and ignore everything */
-               for (;buf != 0x00; buf++);
+       else  {
+               *buffer = NULL;
+               *url_decoded = NULL;
+               return;
+       }
        
        tmp[i]       = 0x00;
        
        tmp[i]       = 0x00;
-       *url_decoded = 0x00;
+       *url_decoded = NULL;
+       *buffer = NULL;
        
        if (i == maxlen) {
        
        if (i == maxlen) {
-               for (;*buf != 0x00; buf++);
                return;
        }
        decode_uri (url_decoded, (const gchar *)tmp);
                return;
        }
        decode_uri (url_decoded, (const gchar *)tmp);