python-ujson/fix-CVE-2022-31117.patch

26 lines
847 B
Diff
Raw Permalink Normal View History

2023-02-28 20:35:08 -05:00
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