]> source.dussan.org Git - rspamd.git/commitdiff
Fix restfull mode when controller has no password.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 1 Dec 2013 19:00:45 +0000 (19:00 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 1 Dec 2013 19:00:45 +0000 (19:00 +0000)
src/controller.c

index b5aba9b90c48e7eceaffa0af92c69427e5735dcb..d59cc297289e6ddadda7219b23d00aefadeec372 100644 (file)
@@ -1226,7 +1226,9 @@ process_header (f_str_t *line, struct controller_session *session)
        else if (*headern == 'p' || *headern == 'P') {
                /* Password header */
                if (g_ascii_strcasecmp (headern, "password") == 0) {
-                       if (line->len == strlen (ctx->password) && memcmp (line->begin, ctx->password, line->len) == 0) {
+                       if (ctx->password == NULL ||
+                                       (line->len == strlen (ctx->password)
+                                       && memcmp (line->begin, ctx->password, line->len) == 0)) {
                                session->authorized = TRUE;
                        }
                        else {