]> git.saurik.com Git - redis.git/commitdiff
rdbLoad() should check REDIS_RDB_VERSION instead of hardcoded number.
authorantirez <antirez@gmail.com>
Tue, 24 Apr 2012 10:53:30 +0000 (12:53 +0200)
committerantirez <antirez@gmail.com>
Tue, 24 Apr 2012 10:53:30 +0000 (12:53 +0200)
src/rdb.c

index f9ad9f941cdf6a4b8fe8e771f30837cfbb4bf35f..cb42aeee10976ecb0a5cc61b149192dccdbb0565 100644 (file)
--- a/src/rdb.c
+++ b/src/rdb.c
@@ -1039,7 +1039,7 @@ int rdbLoad(char *filename) {
         return REDIS_ERR;
     }
     rdbver = atoi(buf+5);
-    if (rdbver < 1 || rdbver > 5) {
+    if (rdbver < 1 || rdbver > REDIS_RDB_VERSION) {
         fclose(fp);
         redisLog(REDIS_WARNING,"Can't handle RDB format version %d",rdbver);
         errno = EINVAL;