fix CVE-2022-31117

This commit is contained in:
huangduirong 2023-02-28 20:35:08 -05:00
parent e135aec5ae
commit 1a2b1ec94f
2 changed files with 30 additions and 1 deletions

25
fix-CVE-2022-31117.patch Normal file
View File

@ -0,0 +1,25 @@
From a68e5b61f3df39cf998911fc87fe277436839902 Mon Sep 17 00:00:00 2001
From: huangduirong <huangduirong@huawei.com>
Date: Tue, 28 Feb 2023 08:59:16 -0500
Subject: [PATCH] x
---
lib/ultrajsondec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/ultrajsondec.c b/lib/ultrajsondec.c
index cfa3be0..3e429c6 100644
--- a/lib/ultrajsondec.c
+++ b/lib/ultrajsondec.c
@@ -330,7 +330,7 @@ static FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_string ( struct DecoderState *ds
escStart = (JSUINT32 *)ds->dec->realloc(ds->escStart, newSize * sizeof(JSUINT32));
if (!escStart)
{
- ds->dec->free(ds->escStart);
+ // Don't free ds->escStart here; it gets handled in JSON_DecodeObject.
return SetError(ds, -1, "Could not reserve memory block");
}
ds->escStart = escStart;
--
2.35.1

View File

@ -1,13 +1,14 @@
%global _empty_manifest_terminate_build 0 %global _empty_manifest_terminate_build 0
Name: python-ujson Name: python-ujson
Version: 5.1.0 Version: 5.1.0
Release: 2 Release: 3
Summary: Ultra fast JSON encoder and decoder for Python Summary: Ultra fast JSON encoder and decoder for Python
License: BSD License: BSD
URL: https://github.com/ultrajson/ultrajson URL: https://github.com/ultrajson/ultrajson
Source0: https://files.pythonhosted.org/packages/92/4a/2676677f59709517560b2b7eeb027453e86643d54d04687602e76cca4380/ujson-5.1.0.tar.gz Source0: https://files.pythonhosted.org/packages/92/4a/2676677f59709517560b2b7eeb027453e86643d54d04687602e76cca4380/ujson-5.1.0.tar.gz
Patch0001: fix-CVE-2022-31116.patch Patch0001: fix-CVE-2022-31116.patch
Patch0002: fix-CVE-2022-31117.patch
%description %description
UltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for Python 3.6+ UltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for Python 3.6+
@ -78,6 +79,9 @@ mv %{buildroot}/doclist.lst .
%{_docdir}/* %{_docdir}/*
%changelog %changelog
* Wed Mar 1 2023 huangduirong <huangduirong@huawei.com> - 5.1.0-3
- fix CVE-2022-31117
* Sun Feb 26 2023 huangduirong <huangduirong@huawei.com> - 5.1.0-2 * Sun Feb 26 2023 huangduirong <huangduirong@huawei.com> - 5.1.0-2
- fix CVE-2022-31116 - fix CVE-2022-31116