Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
228224746f
!80 回合社区补丁
From: @jamesblunt 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2024-10-28 06:30:15 +00:00
zhangyaqi
cca111f05d Fix leak in evconnlistener_new_async() 2024-10-18 04:23:58 +08:00
openeuler-ci-bot
a7b7383811
!67 fix potential Null pointer dereference in regress_finalize.c
From: @zhangxianting 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2024-07-05 09:26:55 +00:00
zhangxianting
fdc37bd888 fix potential Null pointer dereference in regress_finalize.c 2024-06-26 21:55:22 +08:00
openeuler-ci-bot
f7c9afa900
!51 evutil: don't call memset before memcpy
From: @tong_1001 
Reviewed-by: @xiezhipeng1 
Signed-off-by: @xiezhipeng1
2024-04-01 06:14:54 +00:00
shixuantong
fae720c6e0 evutil: don't call memset before memcpy 2024-04-01 11:17:53 +08:00
openeuler-ci-bot
19d7ca9195 !28 use make macros to run check in parallel
From: @yang_zhuang_zhuang
Reviewed-by: @xiezhipeng1
Signed-off-by: @xiezhipeng1
2021-04-22 09:29:45 +08:00
yang_zhuang_zhuang
3772d2c31f use make macros to run check 2021-04-21 11:21:17 +08:00
openeuler-ci-bot
c3908595d5 !25 add debuginfo package and make ELF files stripped
From: @panxh_purple
Reviewed-by: @xiezhipeng1
Signed-off-by: @xiezhipeng1
2021-03-29 17:11:43 +08:00
panxiaohe
5e26acd19c add debuginfo package and make ELF files stripped and remove redundant ABI compatibility library 2021-03-29 10:02:59 +08:00
4 changed files with 137 additions and 6 deletions

View File

@ -0,0 +1,31 @@
From f9939490ebdba403462b6839d29fdc6837d8a0ec Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <azat@libevent.org>
Date: Sun, 18 Feb 2024 21:19:41 +0100
Subject: [PATCH] Fix leak in evconnlistener_new_async()
Fixes: https://github.com/libevent/libevent/issues/414
---
listener.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/listener.c b/listener.c
index f5c00c9..01dc41d 100644
--- a/listener.c
+++ b/listener.c
@@ -885,8 +885,11 @@ evconnlistener_new_async(struct event_base *base,
return &lev->base;
err_free_accepting:
+ for (i = 0; i < lev->n_accepting; ++i) {
+ if (lev->accepting[i])
+ free_and_unlock_accepting_socket(lev->accepting[i]);
+ }
mm_free(lev->accepting);
- /* XXXX free the other elements. */
err_delete_lock:
EVTHREAD_FREE_LOCK(lev->base.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
err_free_lev:
--
2.27.0

View File

@ -0,0 +1,33 @@
From 5c6eaadd24ed432347e55f6827e8d8ac670cd534 Mon Sep 17 00:00:00 2001
From: icy17 <1061499390@qq.com>
Date: Wed, 10 Apr 2024 16:18:27 +0800
Subject: [PATCH] Fix potential Null pointer dereference in regress_finalize.c
Referenxe:https://github.com/libevent/libevent/pull/1598/
---
test/regress_finalize.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/test/regress_finalize.c b/test/regress_finalize.c
index 9e57188..543cd94 100644
--- a/test/regress_finalize.c
+++ b/test/regress_finalize.c
@@ -130,6 +130,7 @@ test_fin_cb_invoked(void *arg)
/* Okay, now add but don't have it become active, and make sure *that*
* works. */
ev = evtimer_new(base, timer_callback, &ev_called);
+ tt_assert(ev);
event_add(ev, &ten_sec);
event_free_finalize(0, ev, event_finalize_callback_1);
@@ -141,6 +142,7 @@ test_fin_cb_invoked(void *arg)
/* Now try adding and deleting after finalizing. */
ev = evtimer_new(base, timer_callback, &ev_called);
+ tt_assert(ev);
evtimer_assign(&ev2, base, timer_callback, &ev_called);
event_add(ev, &ten_sec);
event_free_finalize(0, ev, event_finalize_callback_1);
--
2.27.0

View File

@ -0,0 +1,39 @@
From 39073df8318364fc868ab6d90a345ea4fc66e864 Mon Sep 17 00:00:00 2001
From: Liu Dongmiao <liudongmiao@gmail.com>
Date: Sat, 30 Mar 2024 21:44:50 +0800
Subject: [PATCH] evutil: don't call memset before memcpy
In `evutil_parse_sockaddr_port`, it would `memset` the `out` to zero,
however, the `memset` is unnecessary before `memcpy`, and may cause
undefined behavior if the `outlen` is invalid.
This should close #1573.
Reference:https://github.com/libevent/libevent/commit/39073df8
---
evutil.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/evutil.c b/evutil.c
index 9817f08..cc0133f 100644
--- a/evutil.c
+++ b/evutil.c
@@ -2216,7 +2216,6 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int *
if ((int)sizeof(sin6) > *outlen)
return -1;
sin6.sin6_scope_id = if_index;
- memset(out, 0, *outlen);
memcpy(out, &sin6, sizeof(sin6));
*outlen = sizeof(sin6);
return 0;
@@ -2235,7 +2234,6 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int *
return -1;
if ((int)sizeof(sin) > *outlen)
return -1;
- memset(out, 0, *outlen);
memcpy(out, &sin, sizeof(sin));
*outlen = sizeof(sin);
return 0;
--
2.27.0

View File

@ -1,18 +1,19 @@
%global debug_package %{nil}
Name: libevent
Version: 2.1.12
Release: 1
Release: 6
Summary: An event notification library
License: BSD
URL: http://libevent.org/
Source0: https://github.com/libevent/libevent/releases/download/release-%{version}-stable/libevent-%{version}-stable.tar.gz
BuildRequires: gcc doxygen openssl-devel libevent
BuildRequires: gcc doxygen openssl-devel
Patch0: libevent-nonettests.patch
Patch1: http-add-callback-to-allow-server-to-decline-and-the.patch
Patch6000: backport-evutil-don-t-call-memset-before-memcpy.patch
Patch6001: backport-Fix-potential-Null-pointer-dereference-in-regress_fi.patch
Patch6002: backport-Fix-leak-in-evconnlistener_new_async.patch
%description
Libevent additionally provides a sophisticated framework for buffered network IO, with support for sockets,
@ -36,11 +37,10 @@ with %{name}.
%install
%make_install
cp -a %{_libdir}/libevent* %{buildroot}%{_libdir}
rm -f %{buildroot}%{_libdir}/*.la
%check
make check
%make_build check
%ldconfig_scriptlets
@ -71,6 +71,34 @@ make check
%changelog
* Sun Oct 27 2024 zhangyaqi <zhangyaqi@kylinos.cn> - 2.1.12-6
- Fix leak in evconnlistener_new_async()
* Wed Jul 03 2024 zhangxianting <zhangxianting@uniontech.com> - 2.1.12-5
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:fix potential Null pointer dereference in regress_finalize.c
* Mon Apr 01 2024 shixuantong <shixuantong1@huawei.com> - 2.1.12-4
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:evutil: don't call memset before memcpy
* Wed Apr 21 2021 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 2.1.12-3
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:use make macros to run check
* Mon Mar 29 2021 panxiaohe <panxiaohe@huawei.com> - 2.1.12-2
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:add debuginfo package and make ELF files stripped
remove redundant ABI compatibility library
* Wed Aug 12 2020 Yeqing Peng <pengyeqing@huawei.com> - 2.1.12-1
- update to 2.1.12