Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix limit undefined behavior crash in CLUSTER SLOT-STATS (#709)
We did not set a default value for limit, but it will be used in addReplyOrderBy later, the undefined behavior may crash the server since the value could be negative and crash will happen in addReplyArrayLen. An interesting reproducible example (limit reuses the value of -1): ``` > cluster slot-stats orderby key-count desc limit -1 (error) ERR Limit has to lie in between 1 and 16384 (maximum number of slots). > cluster slot-stats orderby key-count desc Error: Server closed the connection ``` Set the default value of limit to 16384. --------- Signed-off-by: Binbin <[email protected]>
- Loading branch information