Commit 6b818efe authored by Bruce Merry's avatar Bruce Merry
Browse files

Make dbSwapDatabases take args as long

This prevents an integer overflow bug. Closes #5737.
parent e504583b
...@@ -997,7 +997,7 @@ void scanDatabaseForReadyLists(redisDb *db) { ...@@ -997,7 +997,7 @@ void scanDatabaseForReadyLists(redisDb *db) {
* *
* Returns C_ERR if at least one of the DB ids are out of range, otherwise * Returns C_ERR if at least one of the DB ids are out of range, otherwise
* C_OK is returned. */ * C_OK is returned. */
int dbSwapDatabases(int id1, int id2) { int dbSwapDatabases(long id1, long id2) {
if (id1 < 0 || id1 >= server.dbnum || if (id1 < 0 || id1 >= server.dbnum ||
id2 < 0 || id2 >= server.dbnum) return C_ERR; id2 < 0 || id2 >= server.dbnum) return C_ERR;
if (id1 == id2) return C_OK; if (id1 == id2) return C_OK;
......
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