Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
ae1b748b
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ae1b748b
编写于
12月 10, 2018
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed global variable buffer read overflow [#CLICKHOUSE-4191]
上级
aec8c149
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
0 deletion
+11
-0
libs/libcommon/include/common/DateLUTImpl.h
libs/libcommon/include/common/DateLUTImpl.h
+2
-0
libs/libcommon/src/DateLUTImpl.cpp
libs/libcommon/src/DateLUTImpl.cpp
+9
-0
未找到文件。
libs/libcommon/include/common/DateLUTImpl.h
浏览文件 @
ae1b748b
...
...
@@ -247,6 +247,8 @@ public:
time_t
res
=
t
-
lut
[
index
].
date
;
/// NOTE We doesn't support cases when time change result in switching to previous day.
/// Data is cleaned to avoid these cases, so no underflow occurs here.
if
(
res
>=
lut
[
index
].
time_at_offset_change
)
res
+=
lut
[
index
].
amount_of_offset_change
;
...
...
libs/libcommon/src/DateLUTImpl.cpp
浏览文件 @
ae1b748b
...
...
@@ -116,6 +116,15 @@ DateLUTImpl::DateLUTImpl(const std::string & time_zone_)
/* std::cerr << lut[i - 1].year << "-" << int(lut[i - 1].month) << "-" << int(lut[i - 1].day_of_month)
<< " offset was changed at " << lut[i - 1].time_at_offset_change << " for " << lut[i - 1].amount_of_offset_change << " seconds.\n";*/
/** We doesn't support cases when time change results in switching to previous day.
* As an example, it was a case in Moscow at years 1981..1983 on October 1:
* clock was adjusted one hour backwards exactly at midnight (that was lead to extra hour 23 of Sep 30th).
* We must clean data (and we will make it slightly incorrect) to avoid these cases.
* (In previous example, it will lead to extra hour 0 of Sep 30 instead.)
*/
if
(
static_cast
<
int
>
(
lut
[
i
-
1
].
time_at_offset_change
)
+
static_cast
<
int
>
(
lut
[
i
-
1
].
amount_of_offset_change
)
<
0
)
lut
[
i
-
1
].
time_at_offset_change
=
-
lut
[
i
-
1
].
amount_of_offset_change
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录