Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
6b818efe
Commit
6b818efe
authored
Dec 31, 2018
by
Bruce Merry
Browse files
Make dbSwapDatabases take args as long
This prevents an integer overflow bug. Closes #5737.
parent
e504583b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
6b818efe
...
...
@@ -997,7 +997,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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment