Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
c71b72ac
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c71b72ac
编写于
6月 07, 2023
作者:
T
Tomas Mraz
提交者:
Todd Short
6月 10, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Coverity 1528488: Avoid assignment of unused value rctx
Also some move redirection_url inside loop where it is only used.
上级
82b81161
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
7 deletion
+7
-7
crypto/http/http_client.c
crypto/http/http_client.c
+7
-7
未找到文件。
crypto/http/http_client.c
浏览文件 @
c71b72ac
...
@@ -1170,13 +1170,12 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
...
@@ -1170,13 +1170,12 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
const
char
*
expected_ct
,
int
expect_asn1
,
const
char
*
expected_ct
,
int
expect_asn1
,
size_t
max_resp_len
,
int
timeout
)
size_t
max_resp_len
,
int
timeout
)
{
{
char
*
current_url
,
*
redirection_url
=
NULL
;
char
*
current_url
;
int
n_redirs
=
0
;
int
n_redirs
=
0
;
char
*
host
;
char
*
host
;
char
*
port
;
char
*
port
;
char
*
path
;
char
*
path
;
int
use_ssl
;
int
use_ssl
;
OSSL_HTTP_REQ_CTX
*
rctx
=
NULL
;
BIO
*
resp
=
NULL
;
BIO
*
resp
=
NULL
;
time_t
max_time
=
timeout
>
0
?
time
(
NULL
)
+
timeout
:
0
;
time_t
max_time
=
timeout
>
0
?
time
(
NULL
)
+
timeout
:
0
;
...
@@ -1188,6 +1187,9 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
...
@@ -1188,6 +1187,9 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
return
NULL
;
return
NULL
;
for
(;;)
{
for
(;;)
{
OSSL_HTTP_REQ_CTX
*
rctx
;
char
*
redirection_url
;
if
(
!
OSSL_HTTP_parse_url
(
current_url
,
&
use_ssl
,
NULL
/* user */
,
&
host
,
if
(
!
OSSL_HTTP_parse_url
(
current_url
,
&
use_ssl
,
NULL
/* user */
,
&
host
,
&
port
,
NULL
/* port_num */
,
&
path
,
NULL
,
NULL
))
&
port
,
NULL
/* port_num */
,
&
path
,
NULL
,
NULL
))
break
;
break
;
...
@@ -1196,6 +1198,7 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
...
@@ -1196,6 +1198,7 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
use_ssl
,
bio
,
rbio
,
bio_update_fn
,
arg
,
use_ssl
,
bio
,
rbio
,
bio_update_fn
,
arg
,
buf_size
,
timeout
);
buf_size
,
timeout
);
new_rpath:
new_rpath:
redirection_url
=
NULL
;
if
(
rctx
!=
NULL
)
{
if
(
rctx
!=
NULL
)
{
if
(
!
OSSL_HTTP_set1_request
(
rctx
,
path
,
headers
,
if
(
!
OSSL_HTTP_set1_request
(
rctx
,
path
,
headers
,
NULL
/* content_type */
,
NULL
/* content_type */
,
...
@@ -1205,9 +1208,9 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
...
@@ -1205,9 +1208,9 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
0
/* no keep_alive */
))
{
0
/* no keep_alive */
))
{
OSSL_HTTP_REQ_CTX_free
(
rctx
);
OSSL_HTTP_REQ_CTX_free
(
rctx
);
rctx
=
NULL
;
rctx
=
NULL
;
}
else
{
}
else
{
resp
=
OSSL_HTTP_exchange
(
rctx
,
&
redirection_url
);
resp
=
OSSL_HTTP_exchange
(
rctx
,
&
redirection_url
);
}
}
}
}
OPENSSL_free
(
path
);
OPENSSL_free
(
path
);
if
(
resp
==
NULL
&&
redirection_url
!=
NULL
)
{
if
(
resp
==
NULL
&&
redirection_url
!=
NULL
)
{
...
@@ -1222,7 +1225,6 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
...
@@ -1222,7 +1225,6 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
OPENSSL_free
(
host
);
OPENSSL_free
(
host
);
OPENSSL_free
(
port
);
OPENSSL_free
(
port
);
(
void
)
OSSL_HTTP_close
(
rctx
,
1
);
(
void
)
OSSL_HTTP_close
(
rctx
,
1
);
rctx
=
NULL
;
BIO_free
(
resp
);
BIO_free
(
resp
);
OPENSSL_free
(
current_url
);
OPENSSL_free
(
current_url
);
return
NULL
;
return
NULL
;
...
@@ -1232,7 +1234,6 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
...
@@ -1232,7 +1234,6 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
OPENSSL_free
(
host
);
OPENSSL_free
(
host
);
OPENSSL_free
(
port
);
OPENSSL_free
(
port
);
(
void
)
OSSL_HTTP_close
(
rctx
,
1
);
(
void
)
OSSL_HTTP_close
(
rctx
,
1
);
rctx
=
NULL
;
continue
;
continue
;
}
}
/* if redirection not allowed, ignore it */
/* if redirection not allowed, ignore it */
...
@@ -1242,7 +1243,6 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
...
@@ -1242,7 +1243,6 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
OPENSSL_free
(
port
);
OPENSSL_free
(
port
);
if
(
!
OSSL_HTTP_close
(
rctx
,
resp
!=
NULL
))
{
if
(
!
OSSL_HTTP_close
(
rctx
,
resp
!=
NULL
))
{
BIO_free
(
resp
);
BIO_free
(
resp
);
rctx
=
NULL
;
resp
=
NULL
;
resp
=
NULL
;
}
}
break
;
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录