Fix segfault from accessing array out of bounds

argc == 2; argv[2] == crash
This commit is contained in:
Matt Stancliff 2014-03-14 17:38:05 -04:00
parent ed813863f0
commit 584052ee6b

View File

@ -1346,7 +1346,7 @@ char *sentinelHandleConfiguration(char **argv, int argc) {
ri->auth_pass = sdsnew(argv[2]);
} else if (!strcasecmp(argv[0],"current-epoch") && argc == 2) {
/* 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)
sentinel.current_epoch = current_epoch;
} else if (!strcasecmp(argv[0],"config-epoch") && argc == 3) {