summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2023-05-06 15:28:13 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2023-05-06 15:28:13 +0200
commit06a2c251a18d8cc93bcae82270997b27cbc9aaea (patch)
tree5fc77e2546d278cbc47d670dde728184cb38dfc4
parenta800b7e058b09031aba92949eecf2c76fa030635 (diff)
downloadlibxml2-06a2c251a18d8cc93bcae82270997b27cbc9aaea.tar.gz
hash: Fix possible startup crash with old libxslt versions
Call xmlInitParser in xmlHashCreate to make it work if the library wasn't initialized yet. Otherwise, exsltRegisterAll from libxslt 1.1.24 or older might cause a crash. See #534.
-rw-r--r--hash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 479ff467..cbcc4293 100644
--- a/hash.c
+++ b/hash.c
@@ -180,6 +180,8 @@ xmlHashTablePtr
xmlHashCreate(int size) {
xmlHashTablePtr table;
+ xmlInitParser();
+
if (size <= 0)
size = 256;