Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
alios-things
AliOS-Things
提交
a7c04329
A
AliOS-Things
项目概览
alios-things
/
AliOS-Things
9 个月 前同步成功
通知
61
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AliOS-Things
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a7c04329
编写于
11月 26, 2019
作者:
X
xicai.cxc
提交者:
jun-ping
11月 27, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
BugID:23661689:[http] fix long http header memory overflow issue
Change-Id: I416def4177884e50c38fb76af2cd2c73b4eff456
上级
62d494e1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
1 deletion
+12
-1
middleware/linkkit/sdk-c/src/infra/utils/misc/utils_httpc.c
middleware/linkkit/sdk-c/src/infra/utils/misc/utils_httpc.c
+7
-1
middleware/linkkit/sdk-c/src/protocol/http/iotx_http_api.c
middleware/linkkit/sdk-c/src/protocol/http/iotx_http_api.c
+5
-0
未找到文件。
middleware/linkkit/sdk-c/src/infra/utils/misc/utils_httpc.c
浏览文件 @
a7c04329
...
...
@@ -652,7 +652,13 @@ int httpclient_response_parse(httpclient_t *client, char *data, int len, uint32_
/* try to read more header again until find response head ending "\r\n\r\n" */
while
(
NULL
==
(
ptr_body_end
=
strstr
(
data
,
"
\r\n\r\n
"
)))
{
/* try to read more header */
ret
=
httpclient_recv
(
client
,
data
+
len
,
1
,
HTTPCLIENT_RAED_HEAD_SIZE
,
&
new_trf_len
,
iotx_time_left
(
&
timer
));
int
max_remain_len
=
HTTPCLIENT_CHUNK_SIZE
-
len
-
1
;
if
(
max_remain_len
<=
0
)
{
utils_err
(
"buffer exceeded max
\n
"
);
return
ERROR_HTTP_PARSE
;
}
max_remain_len
=
max_remain_len
>
HTTPCLIENT_RAED_HEAD_SIZE
?
HTTPCLIENT_RAED_HEAD_SIZE
:
max_remain_len
;
ret
=
httpclient_recv
(
client
,
data
+
len
,
1
,
max_remain_len
,
&
new_trf_len
,
iotx_time_left
(
&
timer
));
if
(
ret
==
ERROR_HTTP_CONN
)
{
return
ret
;
}
...
...
middleware/linkkit/sdk-c/src/protocol/http/iotx_http_api.c
浏览文件 @
a7c04329
...
...
@@ -531,6 +531,11 @@ int IOT_HTTP_DeviceNameAuth(void *handle)
goto
do_exit
;
}
if
(
strlen
(
pvalue
)
>
IOTX_HTTP_AUTH_TOKEN_LEN
-
1
)
{
http_err
(
"token is out of size"
);
goto
do_exit
;
}
strcpy
(
iotx_http_context
->
p_auth_token
,
pvalue
);
iotx_http_context
->
is_authed
=
1
;
LITE_free
(
pvalue
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录