From 6b1a49e484b242c7e67ca87bd94ec4ee87a00483 Mon Sep 17 00:00:00 2001 From: zhangxingrong Date: Fri, 2 Aug 2024 13:22:15 +0800 Subject: [PATCH] add some upstream patchs --- ...ort-fix-a-coredump-in-TorrentTracker.patch | 31 +++++++++++++ backport-fix-a-null-deref-on-exit.patch | 44 +++++++++++++++++++ lftp.spec | 11 ++++- 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 backport-fix-a-coredump-in-TorrentTracker.patch create mode 100644 backport-fix-a-null-deref-on-exit.patch diff --git a/backport-fix-a-coredump-in-TorrentTracker.patch b/backport-fix-a-coredump-in-TorrentTracker.patch new file mode 100644 index 0000000..0e76676 --- /dev/null +++ b/backport-fix-a-coredump-in-TorrentTracker.patch @@ -0,0 +1,31 @@ +From d67fc14d085849a6b0418bb3e912fea2e94c18d1 Mon Sep 17 00:00:00 2001 +From: "Alexander V. Lukyanov" +Date: Sat, 28 Nov 2020 20:09:11 +0300 +Subject: [PATCH] fix a coredump in TorrentTracker (fix #513) + +--- + src/TorrentTracker.cc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/TorrentTracker.cc b/src/TorrentTracker.cc +index f867c334c..30b531cea 100644 +--- a/src/TorrentTracker.cc ++++ b/src/TorrentTracker.cc +@@ -121,7 +121,7 @@ bool TorrentTracker::AddPeer(const xstring& addr,int port) const + int TorrentTracker::Do() + { + int m=STALL; +- if(Failed()) ++ if(Failed() || !backend) + return m; + if(backend && backend->IsActive()) { + if(tracker_timeout_timer.Stopped()) { +@@ -165,6 +165,8 @@ void TorrentTracker::Start() + } + void TorrentTracker::SendTrackerRequest(const char *event) + { ++ if(!backend) ++ return; + backend->SendTrackerRequest(event); + tracker_timeout_timer.Reset(); + } diff --git a/backport-fix-a-null-deref-on-exit.patch b/backport-fix-a-null-deref-on-exit.patch new file mode 100644 index 0000000..ae967c3 --- /dev/null +++ b/backport-fix-a-null-deref-on-exit.patch @@ -0,0 +1,44 @@ +From ced8ab2f95695aee05424e9aa206cd59a3f90888 Mon Sep 17 00:00:00 2001 +From: "Alexander V. Lukyanov" +Date: Mon, 5 Jul 2021 19:59:33 +0300 +Subject: [PATCH] fix a null deref on exit + +--- + src/Job.cc | 7 +++++-- + src/SMTask.cc | 1 + + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/Job.cc b/src/Job.cc +index 63be3fb56..b783eae42 100644 +--- a/src/Job.cc ++++ b/src/Job.cc +@@ -365,12 +365,15 @@ xstring& Job::FormatJobs(xstring& s,int verbose,int indent) + + void Job::BuryDoneJobs() + { +- xlist_for_each_safe(Job,all_jobs,node,scan,next) ++ xarray to_bury; ++ xlist_for_each(Job,all_jobs,node,scan) + { + if((scan->parent==this || scan->parent==0) && scan->jobno>=0 + && scan->Done()) +- scan->DeleteLater(); ++ to_bury.append(scan); + } ++ for(int i=0; iDeleteLater(); + CollectGarbage(); + } + +diff --git a/src/SMTask.cc b/src/SMTask.cc +index b8a84e2f9..435ab8c3c 100644 +--- a/src/SMTask.cc ++++ b/src/SMTask.cc +@@ -129,6 +129,7 @@ void SMTask::DeleteLater() + { + if(deleting) + return; ++ DEBUG(("DeleteLater(%p) from %p\n",this,current)); + deleting=true; + deleted_tasks.add_tail(deleted_tasks_node); + PrepareToDie(); diff --git a/lftp.spec b/lftp.spec index c0fba45..2d44ffd 100644 --- a/lftp.spec +++ b/lftp.spec @@ -1,7 +1,7 @@ Summary: A sophisticated file transfer program Name: lftp Version: 4.9.2 -Release: 4 +Release: 5 License: GPLv3+ URL: http://lftp.yar.ru/ Source0: http://lftp.yar.ru/ftp/%{name}-%{version}.tar.xz @@ -13,6 +13,8 @@ Patch0: lftp-4.0.9-date_fmt.patch Patch1: Quit-while-source-file-increased.patch Patch6000: backport-Ensure-that-PollVec-enum-matches-poll-values.patch Patch6001: backport-fix-second-find_cmd-Segmentation-fault.patch +Patch6002: backport-fix-a-coredump-in-TorrentTracker.patch +Patch6003: backport-fix-a-null-deref-on-exit.patch %description LFTP is a sophisticated file transfer program supporting a number of @@ -86,6 +88,13 @@ echo "%{_libdir}/lftp/%{version}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arc %changelog +* Fri Aug 2 2024 zhangxingrong - 4.9.2-5 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix a coredump in TorrentTracker (fix #513) + fix a null deref on exit + * Thu Mar 28 2024 chengyechun - 4.9.2-4 - Type:bugfix - CVE:NA -- Gitee