SHA256
8
0
forked from pool/libxml2
Files
libxml2/libxml2-python3-string-null-check.patch
Dirk Mueller b7a7f0a08f Accepting request 1010960 from home:iznogood:branches:devel:libraries:c_c++
- Update to version 2.10.3:
  + Security:
    - [CVE-2022-40304] Fix dict corruption caused by entity
      reference cycles
    - [CVE-2022-40303] Fix integer overflows with XML_PARSE_HUGE
    - Fix overflow check in SAX2.c
  + Build system: cmake: Set SOVERSION
- Rebase patches with quilt.

OBS-URL: https://build.opensuse.org/request/show/1010960
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libxml2?expand=0&rev=183
2022-10-17 07:34:17 +00:00

29 lines
937 B
Diff

From 07b1c4c8a736a31ac4b8ae13ea25d50793dfea83 Mon Sep 17 00:00:00 2001
From: Mike Gorse <mgorse@alum.wpi.edu>
Date: Fri, 25 Jan 2019 12:55:52 -0600
Subject: [PATCH] python: return None if PY_IMPORT_STRING returns NULL
PY_IMPORT_STRING might return NULL on python 3 if, ie, a string can't be
encoded. We should check for this and return None, rather than returning
NULL. Fixes a NULL pointer dereference when reporting an error with an
invalid string.
---
python/types.c | 4 ++++
1 file changed, 4 insertions(+)
Index: libxml2-2.10.3/python/types.c
===================================================================
--- libxml2-2.10.3.orig/python/types.c
+++ libxml2-2.10.3/python/types.c
@@ -274,6 +274,10 @@ libxml_charPtrConstWrap(const char *str)
return (Py_None);
}
ret = PY_IMPORT_STRING(str);
+ if (ret == NULL) {
+ Py_INCREF(Py_None);
+ return (Py_None);
+ }
return (ret);
}