Commit 9de07558 authored by Matt Stancliff's avatar Matt Stancliff Committed by antirez
Browse files

Fix segfault from accessing array out of bounds

argc == 2; argv[2] == crash
parent a31a0b43
...@@ -1346,7 +1346,7 @@ char *sentinelHandleConfiguration(char **argv, int argc) { ...@@ -1346,7 +1346,7 @@ char *sentinelHandleConfiguration(char **argv, int argc) {
ri->auth_pass = sdsnew(argv[2]); ri->auth_pass = sdsnew(argv[2]);
} else if (!strcasecmp(argv[0],"current-epoch") && argc == 2) { } else if (!strcasecmp(argv[0],"current-epoch") && argc == 2) {
/* current-epoch <epoch> */ /* current-epoch <epoch> */
unsigned long long current_epoch = strtoull(argv[2],NULL,10); unsigned long long current_epoch = strtoull(argv[1],NULL,10);
if (current_epoch > sentinel.current_epoch) if (current_epoch > sentinel.current_epoch)
sentinel.current_epoch = current_epoch; sentinel.current_epoch = current_epoch;
} else if (!strcasecmp(argv[0],"config-epoch") && argc == 3) { } else if (!strcasecmp(argv[0],"config-epoch") && argc == 3) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment