diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-02-14 02:49:59 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-02-14 02:49:59 +0300 |
commit | d479b7c8ed1ce247d7c8beebe8870e24a151b357 (patch) | |
tree | bbbfc0ca8d0615aba27f777f5776a73a36837ddb /lib | |
parent | 740e75b5db4ad3280a622192ff370a9e6e45b6da (diff) | |
download | rspamd-d479b7c8ed1ce247d7c8beebe8870e24a151b357.tar.gz rspamd-d479b7c8ed1ce247d7c8beebe8870e24a151b357.zip |
Fix bug with several metrics output. [1]
Install surbl-whitelist. [1]
[1] Reported by Victor Ustugov
Diffstat (limited to 'lib')
-rw-r--r-- | lib/librspamdclient.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/librspamdclient.c b/lib/librspamdclient.c index 2bc45c888..ef4518e51 100644 --- a/lib/librspamdclient.c +++ b/lib/librspamdclient.c @@ -258,16 +258,17 @@ parse_rspamd_metric_line (struct rspamd_connection *conn, guint len, GError **er struct rspamd_metric *new; p = b; - c = b; + + while (g_ascii_isspace (*p)) { + p ++; + } + c = p; + while (p - b < remain) { switch (state) { case 0: /* Read metric's name */ - if (g_ascii_isspace (*p)) { - state = 99; - next_state = 0; - } - else if (*p == ';') { + if (*p == ';') { if (p - c <= 1) { /* Empty metric name */ goto err; |