mirror of
https://github.com/libretro/Lakka-LibreELEC.git
synced 2024-11-27 02:20:29 +00:00
Python3: update to 3.11.2
This commit is contained in:
parent
f9f4dc976a
commit
83fbfb5bd6
@ -3,8 +3,8 @@
|
||||
|
||||
PKG_NAME="Python3"
|
||||
# When changing PKG_VERSION remember to sync PKG_PYTHON_VERSION!
|
||||
PKG_VERSION="3.11.1"
|
||||
PKG_SHA256="85879192f2cffd56cb16c092905949ebf3e5e394b7f764723529637901dfb58f"
|
||||
PKG_VERSION="3.11.2"
|
||||
PKG_SHA256="29e4b8f5f1658542a8c13e2dd277358c9c48f2b2f7318652ef1675e402b9d2af"
|
||||
PKG_LICENSE="OSS"
|
||||
PKG_SITE="https://www.python.org/"
|
||||
PKG_URL="https://www.python.org/ftp/python/${PKG_VERSION}/${PKG_NAME::-1}-${PKG_VERSION}.tar.xz"
|
||||
|
@ -1,109 +0,0 @@
|
||||
From df132206a30bc952f9469aaabb6be59f6d285456 Mon Sep 17 00:00:00 2001
|
||||
From: mglae <mglmail@arcor.de>
|
||||
Date: Mon, 2 Jan 2023 15:03:02 +0100
|
||||
Subject: [PATCH] Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the
|
||||
heap memory (GH-24061)"
|
||||
|
||||
This reverts commit 7c83eaa536d2f436ae46211ca48692f576c732f0.
|
||||
|
||||
_elementtree.c still having `static struct PyExpat_CAPI *expat_capi;` can crash
|
||||
because of use after free.
|
||||
---
|
||||
Modules/pyexpat.c | 67 +++++++++++++++++++----------------------------
|
||||
1 file changed, 27 insertions(+), 40 deletions(-)
|
||||
|
||||
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
|
||||
index a971342222..a74d8046c4 100644
|
||||
--- a/Modules/pyexpat.c
|
||||
+++ b/Modules/pyexpat.c
|
||||
@@ -1886,13 +1886,6 @@ add_features(PyObject *mod)
|
||||
}
|
||||
#endif
|
||||
|
||||
-static void
|
||||
-pyexpat_destructor(PyObject *op)
|
||||
-{
|
||||
- void *p = PyCapsule_GetPointer(op, PyExpat_CAPSULE_NAME);
|
||||
- PyMem_Free(p);
|
||||
-}
|
||||
-
|
||||
static int
|
||||
pyexpat_exec(PyObject *mod)
|
||||
{
|
||||
@@ -1980,46 +1973,40 @@ pyexpat_exec(PyObject *mod)
|
||||
MYCONST(XML_PARAM_ENTITY_PARSING_ALWAYS);
|
||||
#undef MYCONST
|
||||
|
||||
- struct PyExpat_CAPI *capi = PyMem_Calloc(1, sizeof(struct PyExpat_CAPI));
|
||||
- if (capi == NULL) {
|
||||
- PyErr_NoMemory();
|
||||
- return -1;
|
||||
- }
|
||||
+ static struct PyExpat_CAPI capi;
|
||||
/* initialize pyexpat dispatch table */
|
||||
- capi->size = sizeof(*capi);
|
||||
- capi->magic = PyExpat_CAPI_MAGIC;
|
||||
- capi->MAJOR_VERSION = XML_MAJOR_VERSION;
|
||||
- capi->MINOR_VERSION = XML_MINOR_VERSION;
|
||||
- capi->MICRO_VERSION = XML_MICRO_VERSION;
|
||||
- capi->ErrorString = XML_ErrorString;
|
||||
- capi->GetErrorCode = XML_GetErrorCode;
|
||||
- capi->GetErrorColumnNumber = XML_GetErrorColumnNumber;
|
||||
- capi->GetErrorLineNumber = XML_GetErrorLineNumber;
|
||||
- capi->Parse = XML_Parse;
|
||||
- capi->ParserCreate_MM = XML_ParserCreate_MM;
|
||||
- capi->ParserFree = XML_ParserFree;
|
||||
- capi->SetCharacterDataHandler = XML_SetCharacterDataHandler;
|
||||
- capi->SetCommentHandler = XML_SetCommentHandler;
|
||||
- capi->SetDefaultHandlerExpand = XML_SetDefaultHandlerExpand;
|
||||
- capi->SetElementHandler = XML_SetElementHandler;
|
||||
- capi->SetNamespaceDeclHandler = XML_SetNamespaceDeclHandler;
|
||||
- capi->SetProcessingInstructionHandler = XML_SetProcessingInstructionHandler;
|
||||
- capi->SetUnknownEncodingHandler = XML_SetUnknownEncodingHandler;
|
||||
- capi->SetUserData = XML_SetUserData;
|
||||
- capi->SetStartDoctypeDeclHandler = XML_SetStartDoctypeDeclHandler;
|
||||
- capi->SetEncoding = XML_SetEncoding;
|
||||
- capi->DefaultUnknownEncodingHandler = PyUnknownEncodingHandler;
|
||||
+ capi.size = sizeof(capi);
|
||||
+ capi.magic = PyExpat_CAPI_MAGIC;
|
||||
+ capi.MAJOR_VERSION = XML_MAJOR_VERSION;
|
||||
+ capi.MINOR_VERSION = XML_MINOR_VERSION;
|
||||
+ capi.MICRO_VERSION = XML_MICRO_VERSION;
|
||||
+ capi.ErrorString = XML_ErrorString;
|
||||
+ capi.GetErrorCode = XML_GetErrorCode;
|
||||
+ capi.GetErrorColumnNumber = XML_GetErrorColumnNumber;
|
||||
+ capi.GetErrorLineNumber = XML_GetErrorLineNumber;
|
||||
+ capi.Parse = XML_Parse;
|
||||
+ capi.ParserCreate_MM = XML_ParserCreate_MM;
|
||||
+ capi.ParserFree = XML_ParserFree;
|
||||
+ capi.SetCharacterDataHandler = XML_SetCharacterDataHandler;
|
||||
+ capi.SetCommentHandler = XML_SetCommentHandler;
|
||||
+ capi.SetDefaultHandlerExpand = XML_SetDefaultHandlerExpand;
|
||||
+ capi.SetElementHandler = XML_SetElementHandler;
|
||||
+ capi.SetNamespaceDeclHandler = XML_SetNamespaceDeclHandler;
|
||||
+ capi.SetProcessingInstructionHandler = XML_SetProcessingInstructionHandler;
|
||||
+ capi.SetUnknownEncodingHandler = XML_SetUnknownEncodingHandler;
|
||||
+ capi.SetUserData = XML_SetUserData;
|
||||
+ capi.SetStartDoctypeDeclHandler = XML_SetStartDoctypeDeclHandler;
|
||||
+ capi.SetEncoding = XML_SetEncoding;
|
||||
+ capi.DefaultUnknownEncodingHandler = PyUnknownEncodingHandler;
|
||||
#if XML_COMBINED_VERSION >= 20100
|
||||
- capi->SetHashSalt = XML_SetHashSalt;
|
||||
+ capi.SetHashSalt = XML_SetHashSalt;
|
||||
#else
|
||||
- capi->SetHashSalt = NULL;
|
||||
+ capi.SetHashSalt = NULL;
|
||||
#endif
|
||||
|
||||
/* export using capsule */
|
||||
- PyObject *capi_object = PyCapsule_New(capi, PyExpat_CAPSULE_NAME,
|
||||
- pyexpat_destructor);
|
||||
+ PyObject *capi_object = PyCapsule_New(&capi, PyExpat_CAPSULE_NAME, NULL);
|
||||
if (capi_object == NULL) {
|
||||
- PyMem_Free(capi);
|
||||
return -1;
|
||||
}
|
||||
|
||||
--
|
||||
2.35.3
|
||||
|
Loading…
Reference in New Issue
Block a user