0 Star 0 Fork 15

openeuler-embedded/cyrus-sasl

forked from src-openEuler/cyrus-sasl 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-Prevent-double-free-of-RC4-context.patch 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 10:36 . Package init
From ca6c587cc9da51235b125a97e841fa786aaad7ff Mon Sep 17 00:00:00 2001
From: Simo Sorce <simo@redhat.com>
Date: Tue, 16 Apr 2019 10:18:43 -0400
Subject: [PATCH 3/3] Prevent double free of RC4 context
Signed-off-by: Simo Sorce <simo@redhat.com>
---
plugins/digestmd5.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/plugins/digestmd5.c b/plugins/digestmd5.c
index f184c16..df35093 100644
--- a/plugins/digestmd5.c
+++ b/plugins/digestmd5.c
@@ -1224,8 +1224,14 @@ static void free_rc4(context_t *text)
{
/* free rc4 context structures */
- if(text->cipher_enc_context) text->utils->free(text->cipher_enc_context);
- if(text->cipher_dec_context) text->utils->free(text->cipher_dec_context);
+ if (text->cipher_enc_context) {
+ text->utils->free(text->cipher_enc_context);
+ text->cipher_enc_context = NULL;
+ }
+ if (text->cipher_dec_context) {
+ text->utils->free(text->cipher_dec_context);
+ text->cipher_dec_context = NULL;
+ }
}
static int init_rc4(context_t *text,
--
2.7.4
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler-embedded/cyrus-sasl.git
git@gitee.com:openeuler-embedded/cyrus-sasl.git
openeuler-embedded
cyrus-sasl
cyrus-sasl
openEuler-embedded

搜索帮助