Fix CVE-2022-34481

This commit is contained in:
lvfei 2024-05-29 11:10:58 +08:00
parent e333b6f4ef
commit 3874f49218
2 changed files with 33 additions and 2 deletions

26
CVE-2022-34481.patch Normal file
View File

@ -0,0 +1,26 @@
From a928758612e67c4496bd9acf48bf66259c809782 Mon Sep 17 00:00:00 2001
From: Nika Layzell <nika@thelayzells.com>
Date: Tue, 07 Jun 2022 17:06:41 +0000 (24 months ago)
Subject: [PATCH] CVE-2022-34481
---
xpcom/ds/nsTArray.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/xpcom/ds/nsTArray.h b/xpcom/ds/nsTArray.h
index e368968359..61d7586233 100644
--- a/xpcom/ds/nsTArray.h
+++ b/xpcom/ds/nsTArray.h
@@ -2351,6 +2351,9 @@ auto nsTArray_Impl<E, Alloc>::ReplaceElementsAtInternal(index_type aStart,
if (MOZ_UNLIKELY(aStart > Length())) {
InvalidArrayIndex_CRASH(aStart, Length());
}
+ if (MOZ_UNLIKELY(aCount > Length() - aStart)) {
+ InvalidArrayIndex_CRASH(aStart + aCount, Length());
+ }
// Adjust memory allocation up-front to catch errors.
if (!ActualAlloc::Successful(this->template EnsureCapacity<ActualAlloc>(
--
2.27.0

View File

@ -88,7 +88,7 @@
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 79.0
Release: 21
Release: 22
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}/source/firefox-%{version}.source.tar.xz
@ -200,6 +200,7 @@ Patch656: CVE-2023-44488.patch
Patch657: CVE-2020-26950.patch
Patch658: CVE-2020-26971.patch
Patch659: CVE-2021-29946.patch
Patch660: CVE-2022-34481.patch
%if %{?system_nss}
BuildRequires: pkgconfig(nspr) >= %{nspr_version} pkgconfig(nss) >= %{nss_version}
@ -394,6 +395,7 @@ tar -xf %{SOURCE3}
%patch657 -p1
%patch658 -p1
%patch659 -p1
%patch660 -p1
%{__rm} -f .mozconfig
%{__cp} %{SOURCE10} .mozconfig
@ -842,8 +844,11 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif
%changelog
* Mon May 27 2024 lvfei <lvfei@kylinos.cn> - 79.0-22
- Fix CVE-2022-34481
* Mon May 13 2024 lvfei <lvfei@kylinos.cn> - 79.0-21
- Fix CVE-2021-29946.patch
- Fix CVE-2021-29946
* Tue May 07 2024 lvfei <lvfei@kylinos.cn> - 79.0-20
- Fix CVE-2020-26971