]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix crash on OpenBSD in `url_email_start`
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 23 Sep 2016 11:38:45 +0000 (12:38 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 23 Sep 2016 11:38:45 +0000 (12:38 +0100)
Issue: #969
MFH: true

src/libserver/url.c

index cc6cfbb3a834652c136c9903473fb865d6520168..7231934fd2ce3325ee47a6e24326645c4bf68d27 100644 (file)
@@ -1925,9 +1925,13 @@ url_email_start (struct url_callback_data *cb,
                        cb->last_at = NULL;
                        return FALSE;
                }
+               else if (pos == cb->begin) {
+                       /* Just @ at the start of input */
+                       return FALSE;
+               }
        }
 
-       if (pos > cb->begin - 1) {
+       if (pos >= cb->begin + 1) {
                match->st = *(pos - 1);
        }
        else {