[libxslt] Fix a mutex deadlock on unregistered extensions
- From: Daniel Veillard <veillard src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libxslt] Fix a mutex deadlock on unregistered extensions
- Date: Tue, 8 Sep 2009 08:23:40 +0000 (UTC)
commit 8619ab630e705805cafa4ba24c94b6c1311d0e01
Author: Nix <nix esperi org uk>
Date: Tue Sep 8 10:22:13 2009 +0200
Fix a mutex deadlock on unregistered extensions
* libxslt/extensions.c: both xsltExtModuleFunctionLookup() and
xsltExtModuleRegisterDynamic() take the xsltExtMutex, but the
former calls the latter
libxslt/extensions.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/libxslt/extensions.c b/libxslt/extensions.c
index 3b99de8..ebb81f5 100644
--- a/libxslt/extensions.c
+++ b/libxslt/extensions.c
@@ -1424,16 +1424,20 @@ xsltExtModuleFunctionLookup(const xmlChar * name, const xmlChar * URI)
XML_CAST_FPTR(ret) = xmlHashLookup2(xsltFunctionsHash, name, URI);
+ xmlMutexUnlock(xsltExtMutex);
+
/* if lookup fails, attempt a dynamic load on supported platforms */
if (NULL == ret) {
if (!xsltExtModuleRegisterDynamic(URI)) {
+ xmlMutexLock(xsltExtMutex);
+
XML_CAST_FPTR(ret) =
xmlHashLookup2(xsltFunctionsHash, name, URI);
+
+ xmlMutexUnlock(xsltExtMutex);
}
}
- xmlMutexUnlock(xsltExtMutex);
-
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]