Merge pull request #5738 from bmerry/fix-swapdb-int-overflow

Make dbSwapDatabases take args as long
This commit is contained in:
Salvatore Sanfilippo
2019-07-12 12:36:33 +02:00
committed by GitHub

View File

@ -1028,7 +1028,7 @@ void scanDatabaseForReadyLists(redisDb *db) {
*
* Returns C_ERR if at least one of the DB ids are out of range, otherwise
* C_OK is returned. */
int dbSwapDatabases(int id1, int id2) {
int dbSwapDatabases(long id1, long id2) {
if (id1 < 0 || id1 >= server.dbnum ||
id2 < 0 || id2 >= server.dbnum) return C_ERR;
if (id1 == id2) return C_OK;