aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-08-28 15:22:26 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-08-28 15:22:26 +0400
commitd45257c4d9657a98cf80d1248501c29de8a17831 (patch)
tree906156773e9be81bae0476f3cb0565f258c2c949
parent2930bc26cb03546e9be2e38948adfdb2d623b7dd (diff)
downloadrspamd-d45257c4d9657a98cf80d1248501c29de8a17831.tar.gz
rspamd-d45257c4d9657a98cf80d1248501c29de8a17831.zip
* Fix html decoding when '/' are encoded too
-rw-r--r--src/html.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/html.c b/src/html.c
index 8f5664079..5560f920a 100644
--- a/src/html.c
+++ b/src/html.c
@@ -303,7 +303,7 @@ decode_entitles (char *s)
else {
val = strtoul ((e + 3), &end_ptr, base);
}
- if ((end_ptr != NULL && *end_ptr != ';') || !g_ascii_isalnum ((char)val)) {
+ if ((end_ptr != NULL && *end_ptr != ';') || (val == 0 || val > 127)) {
msg_info ("decode_entitles: invalid entitle code, cannot convert, strtoul returned %d, while reading %s", val, end_ptr);
/* Skip undecoded */
t = h;
@@ -388,13 +388,18 @@ parse_tag_url (struct worker_task *task, struct mime_text_part *part, tag_id_t i
c++;
}
- if (len == 0 || g_ascii_strncasecmp (c, "http://", sizeof ("http://") - 1) != 0) {
+ if (len == 0) {
return;
}
url_text = memory_pool_alloc (task->task_pool, len + 1);
g_strlcpy (url_text, c, len + 1);
decode_entitles (url_text);
+
+ if (g_ascii_strncasecmp (url_text, "http://", sizeof ("http://") - 1) != 0) {
+ return;
+ }
+
url = memory_pool_alloc (task->task_pool, sizeof (struct uri));
rc = parse_uri (url, url_text, task->task_pool);