diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-03-10 14:20:14 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-03-10 14:20:14 +0300 |
commit | db2aa89316d180d8137f4f8f96b5193fd627e894 (patch) | |
tree | 81523aa2f68d9a56deb8677c21806f66ba0b8a41 /src/url.c | |
parent | 0f3ffee8009da397270ce1ea127dab84285ed432 (diff) | |
download | rspamd-db2aa89316d180d8137f4f8f96b5193fd627e894.tar.gz rspamd-db2aa89316d180d8137f4f8f96b5193fd627e894.zip |
* Fix 2 memory issues:
- NULL string when trying to check url regexp
- double free of message byte array as mime_stream frees memory in array if it thinks that stream is
owner of array's memory
Diffstat (limited to 'src/url.c')
-rw-r--r-- | src/url.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -859,6 +859,11 @@ url_parse_text (struct worker_task *task, GByteArray *content) int rc; char *url_str = NULL; struct uri *new; + + if (!content->data || content->len == 0) { + msg_warn ("url_parse_text: got empty text part"); + return; + } if (url_init () == 0) { do { @@ -905,6 +910,11 @@ url_parse_html (struct worker_task *task, GByteArray *content) char *url_str = NULL; struct uri *new; + if (!content->data || content->len == 0) { + msg_warn ("url_parse_text: got empty text part"); + return; + } + if (url_init () == 0) { do { rc = g_regex_match_full (html_re, (const char *)content->data, content->len, pos, 0, &info, &err); |