aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-12-01 19:00:45 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-12-01 19:00:45 +0000
commitbd35592ac7f26c6c21553990b2d34b87fe7d1b15 (patch)
tree9490481b5effd560b99fc1ad0dad17200a49f5bc
parentd20c437329331f869237dbc115893ebeb8c7654b (diff)
downloadrspamd-bd35592ac7f26c6c21553990b2d34b87fe7d1b15.tar.gz
rspamd-bd35592ac7f26c6c21553990b2d34b87fe7d1b15.zip
Fix restfull mode when controller has no password.
-rw-r--r--src/controller.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/controller.c b/src/controller.c
index b5aba9b90..d59cc2972 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -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 {