summaryrefslogtreecommitdiffstats
path: root/src/url.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-11-03 17:21:12 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-11-03 17:21:12 +0300
commite3d3e31606aa9a6635af0434797fc2fe842a6a6a (patch)
tree7965e393f965f85bdc79a87817826369714ad85b /src/url.c
parent1c7458522170627a9988a3472c1f7d19612d5feb (diff)
downloadrspamd-e3d3e31606aa9a6635af0434797fc2fe842a6a6a.tar.gz
rspamd-e3d3e31606aa9a6635af0434797fc2fe842a6a6a.zip
Urgent fixes.
Diffstat (limited to 'src/url.c')
-rw-r--r--src/url.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/url.c b/src/url.c
index e801527bd..3b96c083e 100644
--- a/src/url.c
+++ b/src/url.c
@@ -1169,7 +1169,8 @@ url_parse_text (memory_pool_t * pool, struct worker_task *task, struct mime_text
}
while (p < end) {
if (url_try_text (pool, p, end - p, &off, &url_str)) {
- if (g_tree_lookup (is_html ? part->html_urls : part->urls, url_str) == NULL) {
+ if (url_str != NULL &&
+ g_tree_lookup (is_html ? part->html_urls : part->urls, url_str) == NULL) {
new = memory_pool_alloc0 (pool, sizeof (struct uri));
if (new != NULL) {
g_strstrip (url_str);
@@ -1215,6 +1216,9 @@ url_try_text (memory_pool_t *pool, const gchar *begin, gsize len, gint *res, gch
(*url_str)[m.m_len] = '\0';
}
+ else {
+ *url_str = NULL;
+ }
if (res) {
*res = strlen (matcher->pattern);
}