summaryrefslogtreecommitdiff
path: root/src/cluster.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cluster.c')
-rw-r--r--src/cluster.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cluster.c b/src/cluster.c
index a9fedce0c..2da0f54fc 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -243,6 +243,7 @@ int clusterLoadConfig(char *filename) {
*p = '\0';
direction = p[1]; /* Either '>' or '<' */
slot = atoi(argv[j]+1);
+ if (slot < 0 || slot >= CLUSTER_SLOTS) goto fmterr;
p += 3;
cn = clusterLookupNode(p);
if (!cn) {
@@ -262,6 +263,8 @@ int clusterLoadConfig(char *filename) {
} else {
start = stop = atoi(argv[j]);
}
+ if (start < 0 || start >= CLUSTER_SLOTS) goto fmterr;
+ if (stop < 0 || stop >= CLUSTER_SLOTS) goto fmterr;
while(start <= stop) clusterAddSlot(n, start++);
}