Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
miniob
提交
2c59c5ea
M
miniob
项目概览
oceanbase
/
miniob
大约 1 年 前同步成功
通知
74
Star
1521
Fork
537
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
M
miniob
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2c59c5ea
编写于
10月 28, 2022
作者:
Y
Yu Dou
提交者:
GitHub
10月 28, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed heap-buffer-overflow (#116)
上级
ecd235de
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
3 deletion
+6
-3
deps/common/io/io.cpp
deps/common/io/io.cpp
+2
-0
unitest/pidfile_test.cpp
unitest/pidfile_test.cpp
+4
-3
未找到文件。
deps/common/io/io.cpp
浏览文件 @
2c59c5ea
...
...
@@ -72,6 +72,8 @@ int readFromFile(const std::string &fileName, char *&outputData, size_t &fileSiz
fclose
(
file
);
data
=
(
char
*
)
lrealloc
(
data
,
readSize
+
1
);
data
[
readSize
]
=
'\0'
;
outputData
=
data
;
fileSize
=
readSize
;
return
0
;
...
...
unitest/pidfile_test.cpp
浏览文件 @
2c59c5ea
...
...
@@ -30,8 +30,7 @@ int main()
std
::
string
pidFile
=
getPidPath
();
char
buf
[
1024
]
=
{
0
};
char
*
p
=
buf
;
char
*
p
=
NULL
;
size_t
size
=
0
;
readFromFile
(
pidFile
,
p
,
size
);
...
...
@@ -39,5 +38,7 @@ int main()
long
long
target
=
0
;
str_to_val
(
temp
,
target
);
free
(
p
);
EXPECT_EQ
(
pid
,
target
);
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录