Skip to content
Permalink
Browse files Browse the repository at this point in the history
fix segfault in "lru" command
fixes #474 - off by one in token count.
  • Loading branch information
dormando committed Apr 27, 2019
1 parent 4627095 commit d35334f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions memcached.c
Expand Up @@ -4632,7 +4632,7 @@ static void process_lru_command(conn *c, token_t *tokens, const size_t ntokens)
out_string(c, "OK");
}
}
} else if (strcmp(tokens[1].value, "mode") == 0 && ntokens >= 3 &&
} else if (strcmp(tokens[1].value, "mode") == 0 && ntokens >= 4 &&
settings.lru_maintainer_thread) {
if (strcmp(tokens[2].value, "flat") == 0) {
settings.lru_segmented = false;
Expand All @@ -4643,7 +4643,7 @@ static void process_lru_command(conn *c, token_t *tokens, const size_t ntokens)
} else {
out_string(c, "ERROR");
}
} else if (strcmp(tokens[1].value, "temp_ttl") == 0 && ntokens >= 3 &&
} else if (strcmp(tokens[1].value, "temp_ttl") == 0 && ntokens >= 4 &&
settings.lru_maintainer_thread) {
if (!safe_strtol(tokens[2].value, &ttl)) {
out_string(c, "ERROR");
Expand Down

0 comments on commit d35334f

Please sign in to comment.