提交 2b8654f1 编写于 作者: M mlinlmcc 提交者: Gitee

修改不合法IP校验范围

上级 cb51e7a6
...@@ -816,9 +816,8 @@ LITE_TEST_CASE(LwipFuncTestSuite, testInetPtonIpv4Abnormal, Function | MediumTes ...@@ -816,9 +816,8 @@ LITE_TEST_CASE(LwipFuncTestSuite, testInetPtonIpv4Abnormal, Function | MediumTes
{ {
int ret; int ret;
struct in_addr rst; struct in_addr rst;
char cpAddrs[10][16] = {"255", "256", "255.0", "255.0.0", "256.0.0.1", "a.a.a.a", "....", "#", char cpAddrs[6][16] = {"256.0.0.1", "a.a.a.a", "....", "#", "127.0.0.f", "0:0:0:0:0:0:0:1"};
"127.0.0.f", "0:0:0:0:0:0:0:1"}; for (int i = 0; i < 6; i++) {
for (int i = 0; i < 10; i++) {
ret = inet_pton(AF_INET, cpAddrs[i], &rst); ret = inet_pton(AF_INET, cpAddrs[i], &rst);
TEST_ASSERT_EQUAL_INT(0, ret); TEST_ASSERT_EQUAL_INT(0, ret);
printf("inet_pton error, cpAddr[%s]\n", cpAddrs[i]); printf("inet_pton error, cpAddr[%s]\n", cpAddrs[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册