summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/urldb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/content/urldb.c b/content/urldb.c
index 50c15810d..a3a75799a 100644
--- a/content/urldb.c
+++ b/content/urldb.c
@@ -1915,6 +1915,9 @@ struct path_data *urldb_find_url(const char *url)
/* generate plq */
if (components.path)
len += strlen(components.path);
+ else
+ len += SLEN("/");
+
if (components.query)
len += strlen(components.query) + 1;
@@ -1931,7 +1934,11 @@ struct path_data *urldb_find_url(const char *url)
if (components.path) {
strcpy(copy, components.path);
copy += strlen(components.path);
+ } else {
+ strcpy(copy, "/");
+ copy += SLEN("/");
}
+
if (components.query) {
*copy++ = '?';
strcpy(copy, components.query);