Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
39a1d399
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
39a1d399
编写于
8月 13, 2021
作者:
O
openharmony_ci
提交者:
Gitee
8月 13, 2021
浏览文件
操作
浏览文件
下载
差异文件
!399 fix security alarm
Merge pull request !399 from 余明星/cherry-pick-1628654200
上级
c8379062
ba2a9d76
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
4 deletion
+10
-4
kernel_lite/io_posix/src/IoTestStdio.cpp
kernel_lite/io_posix/src/IoTestStdio.cpp
+1
-0
kernel_lite/mem_posix/src/ActsMemApiTest.cpp
kernel_lite/mem_posix/src/ActsMemApiTest.cpp
+6
-1
kernel_lite/net_posix/src/ActsNetTest.cpp
kernel_lite/net_posix/src/ActsNetTest.cpp
+3
-3
未找到文件。
kernel_lite/io_posix/src/IoTestStdio.cpp
浏览文件 @
39a1d399
...
...
@@ -334,6 +334,7 @@ HWTEST_F(IoTest, testVasprintf, Function | MediumTest | Level1)
ret
=
FormatVasprintf
(
&
buf
,
"%f and %c as well as %ld
\n
"
,
2.2
,
'c'
,
6
);
EXPECT_EQ
(
ret
,
28
);
EXPECT_STREQ
(
buf
,
"2.200000 and c as well as 6
\n
"
);
free
(
buf
);
}
/**
...
...
kernel_lite/mem_posix/src/ActsMemApiTest.cpp
浏览文件 @
39a1d399
...
...
@@ -297,8 +297,10 @@ HWTEST_F(ActsMemApiTest, testMemmem_0100, Function | MediumTest | Level1) {
LogPrint
(
" memmem *haystack:='%s' size_haystack:='%d' "
,
srcStr
,
strlen
(
srcStr
));
LogPrint
(
"*needle:='%s' size_needle:='%d',
\n
"
,
srcSubStr
,
strlen
(
srcSubStr
));
if
(
strlen
(
srcStr
)
>=
strlen
(
srcSubStr
))
{
pos
=
(
char
*
)
memmem
(
srcStr
,
strlen
(
srcStr
),
srcSubStr
,
strlen
(
srcSubStr
));
LogPrint
(
" --> return pos:='%x'
\n
"
,
pos
);
}
ASSERT_TRUE
(
pos
)
<<
"ErrInfo: memmem *haystack:='"
<<
srcStr
<<
" size_haystack:='"
...
...
@@ -315,7 +317,10 @@ HWTEST_F(ActsMemApiTest, testMemmem_1000, Function | MediumTest | Level1) {
char
srcStr
[]
=
"this is str a;"
;
char
srcSubStr
[]
=
"strb"
;
char
*
pos
=
nullptr
;
if
(
strlen
(
srcStr
)
<
strlen
(
srcSubStr
))
{
FAIL
();
}
pos
=
(
char
*
)
memmem
(
srcStr
,
strlen
(
srcStr
),
srcSubStr
,
strlen
(
srcSubStr
));
LogPrint
(
" memmem *haystack:='%s' size_haystack:='%d' "
,
srcStr
,
strlen
(
srcStr
));
LogPrint
(
"*needle:='%s' size_needle:='%d',
\n
"
,
srcSubStr
,
strlen
(
srcSubStr
));
...
...
kernel_lite/net_posix/src/ActsNetTest.cpp
浏览文件 @
39a1d399
...
...
@@ -236,7 +236,7 @@ static void* SampleTcpServerTask(void *p)
WAIT
();
static
char
bufrec
[
BUF_SIZE
+
1
]
=
{
0
};
memset_s
(
bufrec
,
BUF_SIZE
,
0
,
BUF_SIZE
);
memset_s
(
bufrec
,
sizeof
(
bufrec
)
,
0
,
BUF_SIZE
);
memset_s
(
&
msg
,
sizeof
(
msg
),
0
,
sizeof
(
msg
));
msg
.
msg_name
=
&
clnAddr
;
msg
.
msg_namelen
=
sizeof
(
clnAddr
);
...
...
@@ -331,7 +331,7 @@ static void* SampleTcpClientTask(void *p)
WAIT
();
static
char
bufrec
[
BUF_SIZE
+
1
]
=
{
0
};
memset_s
(
bufrec
,
BUF_SIZE
,
0
,
BUF_SIZE
);
memset_s
(
bufrec
,
sizeof
(
bufrec
)
,
0
,
BUF_SIZE
);
memset_s
(
&
msg
,
sizeof
(
msg
),
0
,
sizeof
(
msg
));
msg
.
msg_name
=
&
clnAddr
;
msg
.
msg_namelen
=
sizeof
(
clnAddr
);
...
...
@@ -340,7 +340,7 @@ static void* SampleTcpClientTask(void *p)
iov
[
0
].
iov_base
=
bufrec
;
iov
[
0
].
iov_len
=
sizeof
(
bufrec
);
ret
=
recvmsg
(
clnFd
,
&
msg
,
0
);
if
(
len
*
strlen
(
g_srvMsg
)
==
(
unsigned
int
)
ret
)
{
if
(
len
*
strlen
(
g_srvMsg
)
==
(
unsigned
int
)
ret
&&
ret
>=
0
)
{
bufrec
[
ret
]
=
0
;
printf
(
"[tcp client]recvmsg, ret=%d, msg[%s]
\n
"
,
ret
,
bufrec
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录