** By default, on server redirects, use the original URL to get the
local file name. Close CVE-2010-2252.
+
+** Fix a problem when -k is used and some URLs are specified trough
+ CSS.
\f
* Changes in Wget 1.12
+2010-07-30 Giuseppe Scrivano <gscrivano@gnu.org>
+
+ * html-url.h (struct map_context): Remove member `tail'.
+
+ * html-url.c (append_url): Append the new url ordered by `position'.
+ (get_urls_html): Do not initialize `ctx.tail'.
+
+ * css-url.c (get_urls_css_file): Do not initialize `ctx.tail'.
+
2010-07-29 Giuseppe Scrivano <gscrivano@gnu.org>
* gnutls.c (wgnutls_peek): Don't read more data if the buffered peek
DEBUGP (("Loaded %s (size %s).\n", file, number_to_static_string (fm->length)));
ctx.text = fm->content;
- ctx.head = ctx.tail = NULL;
+ ctx.head = NULL;
ctx.base = NULL;
ctx.parent_base = url ? url : opt.base_href;
ctx.document_file = file;
else if (link_has_scheme)
newel->link_complete_p = 1;
- if (ctx->tail)
+ /* Append the new URL maintaining the order by position. */
+ if (ctx->head == NULL)
+ ctx->head = newel;
+ else
{
- ctx->tail->next = newel;
- ctx->tail = newel;
+ struct urlpos *it, *prev = NULL;
+
+ it = ctx->head;
+ while (it && position > it->pos)
+ {
+ prev = it;
+ it = it->next;
+ }
+
+ newel->next = it;
+
+ if (prev)
+ prev->next = newel;
+ else
+ ctx->head = newel;
}
- else
- ctx->tail = ctx->head = newel;
return newel;
}
DEBUGP (("Loaded %s (size %s).\n", file, number_to_static_string (fm->length)));
ctx.text = fm->content;
- ctx.head = ctx.tail = NULL;
+ ctx.head = NULL;
ctx.base = NULL;
ctx.parent_base = url ? url : opt.base_href;
ctx.document_file = file;
bool nofollow; /* whether NOFOLLOW was specified in a
<meta name=robots> tag. */
- struct urlpos *head, *tail; /* List of URLs that is being
- built. */
+ struct urlpos *head; /* List of URLs that is being built. */
};
struct urlpos *get_urls_file (const char *);