Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Turbo码先生
redis
提交
e4e5a670
R
redis
项目概览
Turbo码先生
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e4e5a670
编写于
6月 13, 2018
作者:
S
shenlongxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix config_set_numerical_field() integer overflow.
上级
032ea657
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
27 deletion
+27
-27
src/config.c
src/config.c
+27
-27
未找到文件。
src/config.c
浏览文件 @
e4e5a670
...
...
@@ -1062,15 +1062,15 @@ void configSetCommand(client *c) {
/* Numerical fields.
* config_set_numerical_field(name,var,min,max) */
}
config_set_numerical_field
(
"tcp-keepalive"
,
server
.
tcpkeepalive
,
0
,
LLONG
_MAX
)
{
"tcp-keepalive"
,
server
.
tcpkeepalive
,
0
,
INT
_MAX
)
{
}
config_set_numerical_field
(
"maxmemory-samples"
,
server
.
maxmemory_samples
,
1
,
LLONG
_MAX
)
{
"maxmemory-samples"
,
server
.
maxmemory_samples
,
1
,
INT
_MAX
)
{
}
config_set_numerical_field
(
"lfu-log-factor"
,
server
.
lfu_log_factor
,
0
,
LLONG
_MAX
)
{
"lfu-log-factor"
,
server
.
lfu_log_factor
,
0
,
INT
_MAX
)
{
}
config_set_numerical_field
(
"lfu-decay-time"
,
server
.
lfu_decay_time
,
0
,
LLONG
_MAX
)
{
"lfu-decay-time"
,
server
.
lfu_decay_time
,
0
,
INT
_MAX
)
{
}
config_set_numerical_field
(
"timeout"
,
server
.
maxidletime
,
0
,
LONG
_MAX
)
{
"timeout"
,
server
.
maxidletime
,
0
,
INT
_MAX
)
{
}
config_set_numerical_field
(
"active-defrag-threshold-lower"
,
server
.
active_defrag_threshold_lower
,
0
,
1000
)
{
}
config_set_numerical_field
(
...
...
@@ -1082,15 +1082,15 @@ void configSetCommand(client *c) {
}
config_set_numerical_field
(
"active-defrag-cycle-max"
,
server
.
active_defrag_cycle_max
,
1
,
99
)
{
}
config_set_numerical_field
(
"active-defrag-max-scan-fields"
,
server
.
active_defrag_max_scan_fields
,
1
,
L
L
ONG_MAX
)
{
"active-defrag-max-scan-fields"
,
server
.
active_defrag_max_scan_fields
,
1
,
LONG_MAX
)
{
}
config_set_numerical_field
(
"auto-aof-rewrite-percentage"
,
server
.
aof_rewrite_perc
,
0
,
LLONG
_MAX
){
"auto-aof-rewrite-percentage"
,
server
.
aof_rewrite_perc
,
0
,
INT
_MAX
){
}
config_set_numerical_field
(
"hash-max-ziplist-entries"
,
server
.
hash_max_ziplist_entries
,
0
,
L
L
ONG_MAX
)
{
"hash-max-ziplist-entries"
,
server
.
hash_max_ziplist_entries
,
0
,
LONG_MAX
)
{
}
config_set_numerical_field
(
"hash-max-ziplist-value"
,
server
.
hash_max_ziplist_value
,
0
,
L
L
ONG_MAX
)
{
"hash-max-ziplist-value"
,
server
.
hash_max_ziplist_value
,
0
,
LONG_MAX
)
{
}
config_set_numerical_field
(
"stream-node-max-bytes"
,
server
.
stream_node_max_bytes
,
0
,
L
L
ONG_MAX
)
{
"stream-node-max-bytes"
,
server
.
stream_node_max_bytes
,
0
,
LONG_MAX
)
{
}
config_set_numerical_field
(
"stream-node-max-entries"
,
server
.
stream_node_max_entries
,
0
,
LLONG_MAX
)
{
}
config_set_numerical_field
(
...
...
@@ -1098,40 +1098,40 @@ void configSetCommand(client *c) {
}
config_set_numerical_field
(
"list-compress-depth"
,
server
.
list_compress_depth
,
0
,
INT_MAX
)
{
}
config_set_numerical_field
(
"set-max-intset-entries"
,
server
.
set_max_intset_entries
,
0
,
L
L
ONG_MAX
)
{
"set-max-intset-entries"
,
server
.
set_max_intset_entries
,
0
,
LONG_MAX
)
{
}
config_set_numerical_field
(
"zset-max-ziplist-entries"
,
server
.
zset_max_ziplist_entries
,
0
,
L
L
ONG_MAX
)
{
"zset-max-ziplist-entries"
,
server
.
zset_max_ziplist_entries
,
0
,
LONG_MAX
)
{
}
config_set_numerical_field
(
"zset-max-ziplist-value"
,
server
.
zset_max_ziplist_value
,
0
,
L
L
ONG_MAX
)
{
"zset-max-ziplist-value"
,
server
.
zset_max_ziplist_value
,
0
,
LONG_MAX
)
{
}
config_set_numerical_field
(
"hll-sparse-max-bytes"
,
server
.
hll_sparse_max_bytes
,
0
,
L
L
ONG_MAX
)
{
"hll-sparse-max-bytes"
,
server
.
hll_sparse_max_bytes
,
0
,
LONG_MAX
)
{
}
config_set_numerical_field
(
"lua-time-limit"
,
server
.
lua_time_limit
,
0
,
L
L
ONG_MAX
)
{
"lua-time-limit"
,
server
.
lua_time_limit
,
0
,
LONG_MAX
)
{
}
config_set_numerical_field
(
"slowlog-log-slower-than"
,
server
.
slowlog_log_slower_than
,
0
,
LLONG_MAX
)
{
}
config_set_numerical_field
(
"slowlog-max-len"
,
ll
,
0
,
L
L
ONG_MAX
)
{
"slowlog-max-len"
,
ll
,
0
,
LONG_MAX
)
{
/* Cast to unsigned. */
server
.
slowlog_max_len
=
(
unsigned
long
)
ll
;
}
config_set_numerical_field
(
"latency-monitor-threshold"
,
server
.
latency_monitor_threshold
,
0
,
LLONG_MAX
){
}
config_set_numerical_field
(
"repl-ping-slave-period"
,
server
.
repl_ping_slave_period
,
1
,
LLONG
_MAX
)
{
"repl-ping-slave-period"
,
server
.
repl_ping_slave_period
,
1
,
INT
_MAX
)
{
}
config_set_numerical_field
(
"repl-timeout"
,
server
.
repl_timeout
,
1
,
LLONG
_MAX
)
{
"repl-timeout"
,
server
.
repl_timeout
,
1
,
INT
_MAX
)
{
}
config_set_numerical_field
(
"repl-backlog-ttl"
,
server
.
repl_backlog_time_limit
,
0
,
L
L
ONG_MAX
)
{
"repl-backlog-ttl"
,
server
.
repl_backlog_time_limit
,
0
,
LONG_MAX
)
{
}
config_set_numerical_field
(
"repl-diskless-sync-delay"
,
server
.
repl_diskless_sync_delay
,
0
,
LLONG
_MAX
)
{
"repl-diskless-sync-delay"
,
server
.
repl_diskless_sync_delay
,
0
,
INT
_MAX
)
{
}
config_set_numerical_field
(
"slave-priority"
,
server
.
slave_priority
,
0
,
LLONG
_MAX
)
{
"slave-priority"
,
server
.
slave_priority
,
0
,
INT
_MAX
)
{
}
config_set_numerical_field
(
"slave-announce-port"
,
server
.
slave_announce_port
,
0
,
65535
)
{
}
config_set_numerical_field
(
"min-slaves-to-write"
,
server
.
repl_min_slaves_to_write
,
0
,
LLONG
_MAX
)
{
"min-slaves-to-write"
,
server
.
repl_min_slaves_to_write
,
0
,
INT
_MAX
)
{
refreshGoodSlavesCount
();
}
config_set_numerical_field
(
"min-slaves-max-lag"
,
server
.
repl_min_slaves_max_lag
,
0
,
LLONG
_MAX
)
{
"min-slaves-max-lag"
,
server
.
repl_min_slaves_max_lag
,
0
,
INT
_MAX
)
{
refreshGoodSlavesCount
();
}
config_set_numerical_field
(
"cluster-node-timeout"
,
server
.
cluster_node_timeout
,
0
,
LLONG_MAX
)
{
...
...
@@ -1140,17 +1140,17 @@ void configSetCommand(client *c) {
}
config_set_numerical_field
(
"cluster-announce-bus-port"
,
server
.
cluster_announce_bus_port
,
0
,
65535
)
{
}
config_set_numerical_field
(
"cluster-migration-barrier"
,
server
.
cluster_migration_barrier
,
0
,
LLONG
_MAX
){
"cluster-migration-barrier"
,
server
.
cluster_migration_barrier
,
0
,
INT
_MAX
){
}
config_set_numerical_field
(
"cluster-slave-validity-factor"
,
server
.
cluster_slave_validity_factor
,
0
,
LLONG
_MAX
)
{
"cluster-slave-validity-factor"
,
server
.
cluster_slave_validity_factor
,
0
,
INT
_MAX
)
{
}
config_set_numerical_field
(
"hz"
,
server
.
hz
,
0
,
LLONG
_MAX
)
{
"hz"
,
server
.
hz
,
0
,
INT
_MAX
)
{
/* Hz is more an hint from the user, so we accept values out of range
* but cap them to reasonable values. */
if
(
server
.
hz
<
CONFIG_MIN_HZ
)
server
.
hz
=
CONFIG_MIN_HZ
;
if
(
server
.
hz
>
CONFIG_MAX_HZ
)
server
.
hz
=
CONFIG_MAX_HZ
;
}
config_set_numerical_field
(
"watchdog-period"
,
ll
,
0
,
LLONG
_MAX
)
{
"watchdog-period"
,
ll
,
0
,
INT
_MAX
)
{
if
(
ll
)
enableWatchdog
(
ll
);
else
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录