aboutsummaryrefslogtreecommitdiffstats
path: root/src/url.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/url.c')
-rw-r--r--src/url.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/url.c b/src/url.c
index 6a8106b20..c2575f3c8 100644
--- a/src/url.c
+++ b/src/url.c
@@ -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);