diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2007-06-27 15:35:30 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2007-06-27 15:35:30 +0000 |
commit | 18edcf5a40573898785b6a41a38338143e94744c (patch) | |
tree | 1857d29fb58ef6ccef3a92574ff352c23e7c7a0d | |
parent | c2619b5850869f4146f54bb1e9f5bf488350f57e (diff) | |
download | netsurf-18edcf5a40573898785b6a41a38338143e94744c.tar.gz netsurf-18edcf5a40573898785b6a41a38338143e94744c.tar.bz2 |
Move the p->parent check in urldb to before the cookie loop. Prevents the cookie stuff exploding on domain cookies with no path. Fixes breakage with visiting launchpad.net
svn path=/trunk/netsurf/; revision=3368
-rw-r--r-- | content/urldb.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/content/urldb.c b/content/urldb.c index 27ae61aaa..4d4bc3fb2 100644 --- a/content/urldb.c +++ b/content/urldb.c @@ -2460,6 +2460,18 @@ char *urldb_get_cookie(const char *url) } } + if (!p->parent) { + /* No parent, so bail here. This can't go in + * the loop exit condition as we also want to + * process the top-level node. + * + * If p->parent is NULL then p->cookies are + * the domain cookies and thus we don't even + * try matching against them. + */ + break; + } + /* Consider p itself - may be the result of Path=/foo */ for (c = p->cookies; c; c = c->next) { if (c->expires != 1 && c->expires < now) @@ -2491,12 +2503,6 @@ char *urldb_get_cookie(const char *url) count++; } - if (!p->parent) { - /* No parent, so bail here. This can't go in the - * loop exit condition as we want to process the - * top-level node, too */ - break; - } } // LOG(("%s", ret)); |