diff options
| author | Milan Crha <mcrha@redhat.com> | 2007-11-23 10:05:35 +0000 |
|---|---|---|
| committer | Milan Crha <mcrha@src.gnome.org> | 2007-11-23 10:05:35 +0000 |
| commit | 240617860d1dff252a4d9fd2f9f40b884370a577 (patch) | |
| tree | a66e2a899ae5496f2bf2c610aeed6461f201fb9f | |
| parent | 5b8908e71ab11a0b79239e81d501ab480bd69ff5 (diff) | |
| download | evolution-data-server-240617860d1dff252a4d9fd2f9f40b884370a577.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=/trunk/; revision=8236
| -rw-r--r-- | camel/ChangeLog | 7 | ||||
| -rw-r--r-- | camel/camel-url.c | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index adef085e8..a5f5537f4 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 530ad63c1..397bb3da4 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), |
