diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-11-03 17:21:12 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-11-03 17:21:12 +0300 |
commit | e3d3e31606aa9a6635af0434797fc2fe842a6a6a (patch) | |
tree | 7965e393f965f85bdc79a87817826369714ad85b /src | |
parent | 1c7458522170627a9988a3472c1f7d19612d5feb (diff) | |
download | rspamd-e3d3e31606aa9a6635af0434797fc2fe842a6a6a.tar.gz rspamd-e3d3e31606aa9a6635af0434797fc2fe842a6a6a.zip |
Urgent fixes.
Diffstat (limited to 'src')
-rw-r--r-- | src/html.c | 2 | ||||
-rw-r--r-- | src/url.c | 6 | ||||
-rw-r--r-- | src/util.c | 2 | ||||
-rw-r--r-- | src/util.h | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/src/html.c b/src/html.c index 8bbea9548..dee38a86b 100644 --- a/src/html.c +++ b/src/html.c @@ -688,7 +688,7 @@ check_phishing (struct worker_task *task, struct uri *href_url, const gchar *url len = strcspn (url_text, "<>"); - if (url_try_text (task->task_pool, url_text, len, &off, &url_str)) { + if (url_try_text (task->task_pool, url_text, len, &off, &url_str) && url_str != NULL) { new = memory_pool_alloc0 (task->task_pool, sizeof (struct uri)); if (new != NULL) { g_strstrip (url_str); @@ -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); } diff --git a/src/util.c b/src/util.c index df0e444c3..eb1b77e0c 100644 --- a/src/util.c +++ b/src/util.c @@ -1551,7 +1551,7 @@ rspamd_sprintf_num (gchar *buf, gchar *last, guint64 ui64, gchar zero, return ((gchar *)memcpy (buf, p, len)) + len; } -#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MICRO_VERSION == 2) && (GLIB_MINOR_VERSION < 22)) +#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 22)) void g_ptr_array_unref (GPtrArray *array) { diff --git a/src/util.h b/src/util.h index de5df239a..f5ce840be 100644 --- a/src/util.h +++ b/src/util.h @@ -87,7 +87,7 @@ stat_file_t* get_statfile_by_symbol (statfile_pool_t *pool, struct classifier_co const gchar *symbol, struct statfile **st, gboolean try_create); #endif -#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MICRO_VERSION == 2) && (GLIB_MINOR_VERSION < 22)) +#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 22)) void g_ptr_array_unref (GPtrArray *array); #endif /* |