rdbLoad() should check REDIS_RDB_VERSION instead of hardcoded number.

This commit is contained in:
antirez 2012-04-24 12:53:30 +02:00
parent f22cff43a6
commit 053d56a1fa

View File

@ -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;