1 Star 0 Fork 43

pojunxing/openldap

forked from src-openEuler/openldap 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-ITS-9803-Drop-connection-when-receiving-non-LDAP-dat.patch 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
compile_success 提交于 2022-11-07 12:04 . backport patch
From e8813b12b6188d5ba5f174ff8726c438c8ca4bfd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= <ondra@mistotebe.net>
Date: Mon, 7 Mar 2022 10:06:49 +0000
Subject: [PATCH] ITS#9803 Drop connection when receiving non-LDAP data
---
libraries/libldap/result.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c
index c1b4a457f..40ff1c172 100644
--- a/libraries/libldap/result.c
+++ b/libraries/libldap/result.c
@@ -506,6 +506,16 @@ nextresp3:
lc->lconn_ber = NULL;
break;
+ default:
+ /*
+ * We read a BerElement that isn't LDAP or the stream has desync'd.
+ * In either case, anything we read from now on is probably garbage,
+ * just drop the connection.
+ */
+ ber_free( ber, 1 );
+ lc->lconn_ber = NULL;
+ /* FALLTHRU */
+
case LBER_DEFAULT:
fail:
err = sock_errno();
@@ -521,10 +531,6 @@ fail:
}
lc->lconn_status = 0;
return -1;
-
- default:
- ld->ld_errno = LDAP_LOCAL_ERROR;
- return -1;
}
/* message id */
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chengyechun/openldap.git
git@gitee.com:chengyechun/openldap.git
chengyechun
openldap
openldap
master

搜索帮助