mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Add range check for master port in replicaof. (#9201)
So that we can avoid commands that are obviously wrong. Also unified with loadServerConfigFromString because we also checked the range.
This commit is contained in:
parent
5ea3c3db15
commit
3a26f61fb3
@ -2777,7 +2777,8 @@ void replicaofCommand(client *c) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((getLongFromObjectOrReply(c, c->argv[2], &port, NULL) != C_OK))
|
if (getRangeLongFromObjectOrReply(c, c->argv[2], 0, 65535, &port,
|
||||||
|
"Invalid master port") != C_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Check if we are already attached to the specified master */
|
/* Check if we are already attached to the specified master */
|
||||||
|
Loading…
Reference in New Issue
Block a user