aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-20 12:05:00 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-20 12:05:00 +0000
commite7cef66e2e5f84ed1de4ba2c44343ed09f4844b9 (patch)
tree3a1a99bdf16fbc6eee483d0539dfebc7f48211a1
parent1e0c0c6852b708e1a181a012d90a6c8d1e4b01a1 (diff)
downloadrspamd-e7cef66e2e5f84ed1de4ba2c44343ed09f4844b9.tar.gz
rspamd-e7cef66e2e5f84ed1de4ba2c44343ed09f4844b9.zip
Initialize variable earlier.
-rw-r--r--src/libserver/url.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c
index 0f804a6b2..23620f11e 100644
--- a/src/libserver/url.c
+++ b/src/libserver/url.c
@@ -1374,6 +1374,8 @@ rspamd_url_parse (struct rspamd_url *uri, gchar *uristring, gsize len,
return URI_ERRNO_EMPTY;
}
+ p = uristring;
+
if (len > sizeof ("mailto:") - 1) {
/* For mailto: urls we also need to add slashes to make it a valid URL */
if (g_ascii_strncasecmp (p, "mailto:", sizeof ("mailto:") - 1) == 0) {
@@ -1391,7 +1393,6 @@ rspamd_url_parse (struct rspamd_url *uri, gchar *uristring, gsize len,
return URI_ERRNO_BAD_FORMAT;
}
- p = uristring;
for (i = 0; i < UF_MAX; i ++) {
if (u.field_set & (1 << i)) {
comp = p + u.field_data[i].off;