Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
fdb2c6e4
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
接近 2 年 前同步成功
通知
12
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fdb2c6e4
编写于
12月 09, 2009
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
PR: 2124
Submitted by: Jan Pechanec <Jan.Pechanec@Sun.COM> Check for memory allocation failures.
上级
7661ccad
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
59 addition
and
9 deletion
+59
-9
crypto/evp/digest.c
crypto/evp/digest.c
+13
-3
crypto/lhash/lhash.c
crypto/lhash/lhash.c
+29
-4
crypto/rsa/rsa_lib.c
crypto/rsa/rsa_lib.c
+10
-1
crypto/x509/x509_lu.c
crypto/x509/x509_lu.c
+7
-1
未找到文件。
crypto/evp/digest.c
浏览文件 @
fdb2c6e4
...
...
@@ -126,7 +126,8 @@ EVP_MD_CTX *EVP_MD_CTX_create(void)
{
EVP_MD_CTX
*
ctx
=
OPENSSL_malloc
(
sizeof
*
ctx
);
EVP_MD_CTX_init
(
ctx
);
if
(
ctx
)
EVP_MD_CTX_init
(
ctx
);
return
ctx
;
}
...
...
@@ -286,8 +287,17 @@ int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)
if
(
in
->
md_data
&&
out
->
digest
->
ctx_size
)
{
if
(
tmp_buf
)
out
->
md_data
=
tmp_buf
;
else
out
->
md_data
=
OPENSSL_malloc
(
out
->
digest
->
ctx_size
);
if
(
tmp_buf
)
out
->
md_data
=
tmp_buf
;
else
{
out
->
md_data
=
OPENSSL_malloc
(
out
->
digest
->
ctx_size
);
if
(
!
out
->
md_data
)
{
EVPerr
(
EVP_F_EVP_MD_CTX_COPY_EX
,
ERR_R_MALLOC_FAILURE
);
return
0
;
}
}
memcpy
(
out
->
md_data
,
in
->
md_data
,
out
->
digest
->
ctx_size
);
}
...
...
crypto/lhash/lhash.c
浏览文件 @
fdb2c6e4
...
...
@@ -310,16 +310,40 @@ void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg)
static
void
expand
(
_LHASH
*
lh
)
{
LHASH_NODE
**
n
,
**
n1
,
**
n2
,
*
np
;
unsigned
int
p
,
i
,
j
;
unsigned
int
p
,
i
,
j
,
pmax
;
unsigned
long
hash
,
nni
;
p
=
(
int
)
lh
->
p
++
;
nni
=
lh
->
num_alloc_nodes
;
pmax
=
lh
->
pmax
;
if
((
lh
->
p
)
>=
lh
->
pmax
)
{
j
=
(
int
)
lh
->
num_alloc_nodes
*
2
;
n
=
(
LHASH_NODE
**
)
OPENSSL_realloc
(
lh
->
b
,
(
int
)
sizeof
(
LHASH_NODE
*
)
*
j
);
if
(
n
==
NULL
)
{
/* fputs("realloc error in lhash",stderr); */
lh
->
error
++
;
lh
->
p
=
0
;
return
;
}
/* else */
for
(
i
=
(
int
)
lh
->
num_alloc_nodes
;
i
<
j
;
i
++
)
/* 26/02/92 eay */
n
[
i
]
=
NULL
;
/* 02/03/92 eay */
lh
->
pmax
=
lh
->
num_alloc_nodes
;
lh
->
num_alloc_nodes
=
j
;
lh
->
num_expand_reallocs
++
;
lh
->
p
=
0
;
lh
->
b
=
n
;
}
lh
->
num_nodes
++
;
lh
->
num_expands
++
;
p
=
(
int
)
lh
->
p
++
;
n1
=
&
(
lh
->
b
[
p
]);
n2
=
&
(
lh
->
b
[
p
+
(
int
)
lh
->
pmax
]);
n2
=
&
(
lh
->
b
[
p
+
pmax
]);
*
n2
=
NULL
;
/* 27/07/92 - eay - undefined pointer bug */
nni
=
lh
->
num_alloc_nodes
;
for
(
np
=
*
n1
;
np
!=
NULL
;
)
{
...
...
@@ -388,6 +412,7 @@ static void contract(_LHASH *lh)
else
lh
->
p
--
;
lh
->
b
[
idx
]
=
NULL
;
lh
->
num_nodes
--
;
lh
->
num_contracts
++
;
...
...
crypto/rsa/rsa_lib.c
浏览文件 @
fdb2c6e4
...
...
@@ -182,7 +182,16 @@ RSA *RSA_new_method(ENGINE *engine)
ret
->
mt_blinding
=
NULL
;
ret
->
bignum_data
=
NULL
;
ret
->
flags
=
ret
->
meth
->
flags
;
CRYPTO_new_ex_data
(
CRYPTO_EX_INDEX_RSA
,
ret
,
&
ret
->
ex_data
);
if
(
!
CRYPTO_new_ex_data
(
CRYPTO_EX_INDEX_RSA
,
ret
,
&
ret
->
ex_data
))
{
#ifndef OPENSSL_NO_ENGINE
if
(
ret
->
engine
)
ENGINE_finish
(
ret
->
engine
);
#endif
OPENSSL_free
(
ret
);
return
(
NULL
);
}
if
((
ret
->
meth
->
init
!=
NULL
)
&&
!
ret
->
meth
->
init
(
ret
))
{
#ifndef OPENSSL_NO_ENGINE
...
...
crypto/x509/x509_lu.c
浏览文件 @
fdb2c6e4
...
...
@@ -200,7 +200,13 @@ X509_STORE *X509_STORE_new(void)
ret
->
lookup_crls
=
0
;
ret
->
cleanup
=
0
;
CRYPTO_new_ex_data
(
CRYPTO_EX_INDEX_X509_STORE
,
ret
,
&
ret
->
ex_data
);
if
(
!
CRYPTO_new_ex_data
(
CRYPTO_EX_INDEX_X509_STORE
,
ret
,
&
ret
->
ex_data
))
{
sk_X509_OBJECT_free
(
ret
->
objs
);
OPENSSL_free
(
ret
);
return
NULL
;
}
ret
->
references
=
1
;
return
ret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录