summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2007-11-23 10:06:03 +0000
committerMilan Crha <mcrha@src.gnome.org>2007-11-23 10:06:03 +0000
commit5a584068a698e4e21073d5a8fc3bc00bed15c210 (patch)
treee6485e47cc4599bc0d073dce627abc14abe8b0b7
parentcea3163abf4917f344b45186b590ad5ddb094ef2 (diff)
downloadevolution-data-server-5a584068a698e4e21073d5a8fc3bc00bed15c210.tar.gz
** Fix for bug #461979
2007-11-23 Milan Crha <mcrha@redhat.com> ** Fix for bug #461979 * camel-url.c: (camel_url_new_with_base): The base URL can be without a path, so do not crash, if that happen. svn path=/branches/gnome-2-20/; revision=8237
-rw-r--r--camel/ChangeLog7
-rw-r--r--camel/camel-url.c4
2 files changed, 10 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index dc7bde755..08e535733 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,10 @@
+2007-11-23 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #461979
+
+ * camel-url.c: (camel_url_new_with_base):
+ The base URL can be without a path, so do not crash, if that happen.
+
2007-11-22 Milan Crha <mcrha@redhat.com>
** Fix for bug #376425
diff --git a/camel/camel-url.c b/camel/camel-url.c
index 4daa6e9c1..58cd308c7 100644
--- a/camel/camel-url.c
+++ b/camel/camel-url.c
@@ -224,7 +224,9 @@ camel_url_new_with_base (CamelURL *base, const char *url_string)
} else if (*url->path != '/') {
char *newpath, *last, *p, *q;
- last = strrchr (base->path, '/');
+ /* the base->path is NULL if given Content-Base url was without last slash,
+ i.e. like "http://example.com" (this expected only "http://example.com/") */
+ last = base->path ? strrchr (base->path, '/') : NULL;
if (last) {
newpath = g_strdup_printf ("%.*s/%s",
(int)(last - base->path),