summaryrefslogtreecommitdiffstats
path: root/src/worker.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-05 19:29:41 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-05 19:29:41 +0300
commit5b4b47c6c4d81d0ca082617293d7284396998e0d (patch)
treeb01b1921f1941d042996931144f7f51b2464b21d /src/worker.c
parent7487d02f1b3224a913e66d9940adcdaf9c966e7d (diff)
downloadrspamd-5b4b47c6c4d81d0ca082617293d7284396998e0d.tar.gz
rspamd-5b4b47c6c4d81d0ca082617293d7284396998e0d.zip
Fix memory access.
Diffstat (limited to 'src/worker.c')
-rw-r--r--src/worker.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/worker.c b/src/worker.c
index 738002209..8f1177326 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -465,12 +465,12 @@ compare_email_func (gconstpointer a, gconstpointer b)
const struct uri *u1 = a, *u2 = b;
gint r;
- if (u1->hostlen != u2->hostlen) {
+ if (u1->hostlen != u2->hostlen || u1->hostlen == 0) {
return u1->hostlen - u2->hostlen;
}
else {
if ((r = g_ascii_strncasecmp (u1->host, u2->host, u1->hostlen)) == 0){
- if (u1->userlen != u2->userlen) {
+ if (u1->userlen != u2->userlen || u1->userlen == 0) {
return u1->userlen - u2->userlen;
}
else {
@@ -491,7 +491,7 @@ compare_url_func (gconstpointer a, gconstpointer b)
const struct uri *u1 = a, *u2 = b;
int r;
- if (u1->hostlen != u2->hostlen) {
+ if (u1->hostlen != u2->hostlen || u1->hostlen == 0) {
return u1->hostlen - u2->hostlen;
}
else {