1 Star 0 Fork 43

pojunxing/openldap

forked from src-openEuler/openldap 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-ITS-9809-pcache-mdb-fix-SEGV-in-monitor-shutdown.patch 1.69 KB
一键复制 编辑 原始数据 按行查看 历史
compile_success 提交于 2022-11-07 12:04 . backport patch
From e29ba72c5675b7465c3fca95e1c3f3360efa3a97 Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Thu, 10 Mar 2022 15:26:04 +0000
Subject: [PATCH] ITS#9809: pcache, mdb: fix SEGV in monitor shutdown
---
servers/slapd/back-mdb/monitor.c | 3 ++-
servers/slapd/overlays/pcache.c | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/servers/slapd/back-mdb/monitor.c b/servers/slapd/back-mdb/monitor.c
index 7f26074f5..fc77bc60e 100644
--- a/servers/slapd/back-mdb/monitor.c
+++ b/servers/slapd/back-mdb/monitor.c
@@ -578,10 +578,11 @@ mdb_monitor_db_close( BackendDB *be )
monitor_extra_t *mbe;
if ( mi && mi->bi_extra ) {
+ struct berval dummy = BER_BVNULL;
mbe = mi->bi_extra;
mbe->unregister_entry_callback( &mdb->mi_monitor.mdm_ndn,
(monitor_callback_t *)mdb->mi_monitor.mdm_cb,
- NULL, 0, NULL );
+ &dummy, 0, &dummy );
}
memset( &mdb->mi_monitor, 0, sizeof( mdb->mi_monitor ) );
diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c
index fa70d5d2d..fcf29c60b 100644
--- a/servers/slapd/overlays/pcache.c
+++ b/servers/slapd/overlays/pcache.c
@@ -5660,15 +5660,16 @@ pcache_monitor_db_close( BackendDB *be )
slap_overinst *on = (slap_overinst *)be->bd_info;
cache_manager *cm = on->on_bi.bi_private;
- if ( cm->monitor_cb != NULL ) {
+ if ( !BER_BVISNULL( &cm->monitor_ndn )) {
BackendInfo *mi = backend_info( "monitor" );
monitor_extra_t *mbe;
if ( mi && mi->bi_extra ) {
+ struct berval dummy = BER_BVNULL;
mbe = mi->bi_extra;
mbe->unregister_entry_callback( &cm->monitor_ndn,
(monitor_callback_t *)cm->monitor_cb,
- NULL, 0, NULL );
+ &dummy, 0, &dummy );
}
}
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chengyechun/openldap.git
git@gitee.com:chengyechun/openldap.git
chengyechun
openldap
openldap
master

搜索帮助