Index: third_party/libxslt/libxslt/templates.c |
diff --git a/third_party/libxslt/libxslt/templates.c b/third_party/libxslt/libxslt/templates.c |
index 02193f7eef7e04ed71e2136b9b099ac3a6ddcb5e..ad83dce8fd1d8affb11524eeb3e0bbe8ae6bdc02 100644 |
--- a/third_party/libxslt/libxslt/templates.c |
+++ b/third_party/libxslt/libxslt/templates.c |
@@ -63,6 +63,12 @@ xsltEvalXPathPredicate(xsltTransformContextPtr ctxt, xmlXPathCompExprPtr comp, |
xmlNodePtr oldInst; |
int oldProximityPosition, oldContextSize; |
+ if ((ctxt == NULL) || (ctxt->inst == NULL)) { |
+ xsltTransformError(ctxt, NULL, NULL, |
+ "xsltEvalXPathPredicate: No context or instruction\n"); |
+ return(0); |
+ } |
+ |
oldContextSize = ctxt->xpathCtxt->contextSize; |
oldProximityPosition = ctxt->xpathCtxt->proximityPosition; |
oldNsNr = ctxt->xpathCtxt->nsNr; |
@@ -124,6 +130,12 @@ xsltEvalXPathStringNs(xsltTransformContextPtr ctxt, xmlXPathCompExprPtr comp, |
int oldNsNr; |
xmlNsPtr *oldNamespaces; |
+ if ((ctxt == NULL) || (ctxt->inst == NULL)) { |
+ xsltTransformError(ctxt, NULL, NULL, |
+ "xsltEvalXPathStringNs: No context or instruction\n"); |
+ return(0); |
+ } |
+ |
oldInst = ctxt->inst; |
oldNode = ctxt->node; |
oldPos = ctxt->xpathCtxt->proximityPosition; |