summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-04-10 18:42:37 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-04-10 18:42:37 +0000
commit82b4ac72dfd41b0bf0d51cfcf0447efc409a6824 (patch)
tree876e3344a559c9c4a92088260212fb1a04d155b5
parentf61d7fe881c3cac0de02733738c1694d638282cf (diff)
downloadnetsurf-82b4ac72dfd41b0bf0d51cfcf0447efc409a6824.tar.gz
netsurf-82b4ac72dfd41b0bf0d51cfcf0447efc409a6824.tar.bz2
[project @ 2004-04-10 18:42:37 by jmb]
Fix bug in sanity checking code svn path=/import/netsurf/; revision=745
-rw-r--r--desktop/loginlist.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/desktop/loginlist.c b/desktop/loginlist.c
index 3dc7be0da..1baab81ac 100644
--- a/desktop/loginlist.c
+++ b/desktop/loginlist.c
@@ -68,6 +68,7 @@ void login_list_add(char *host, char* logindets) {
/**
* Retrieves an element from the login list
*/
+/** \todo Make the matching spec compliant (see RFC 2617) */
struct login *login_list_get(char *url) {
struct login *nli;
@@ -83,7 +84,8 @@ struct login *login_list_get(char *url) {
return NULL;
host = url_host(url);
- assert(host != 0);
+ if (host == 0 || strlen(host) == 0) return NULL;
+
temp = xstrdup(url);
/* Smallest thing to check for is the scheme + host name + trailing '/'
@@ -92,7 +94,10 @@ struct login *login_list_get(char *url) {
if (strlen(host) > strlen(temp)) {
xfree(temp);
temp = url_host(url);
- assert(temp != 0);
+ if (temp == 0 || strlen(temp) == 0) {
+ xfree(host);
+ return NULL;
+ }
}
xfree(host);