From 5d603a01d8b43758db794f801f329042f5eb98c7 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Sat, 5 May 2018 06:41:29 +0000 Subject: [PATCH] Fix: Fixed a segfault when xsltApplyStylesheet() returns error --- src/xslt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xslt.c b/src/xslt.c index bfc33a3b..2e6797a5 100644 --- a/src/xslt.c +++ b/src/xslt.c @@ -311,9 +311,12 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client) } res = xsltApplyStylesheet(cur, doc, NULL); - - if (xsltSaveResultToString (&string, &len, res, cur) < 0) + if (res != NULL) { + if (xsltSaveResultToString(&string, &len, res, cur) < 0) + problem = 1; + } else { problem = 1; + } /* lets find out the content type and character encoding to use */ if (cur->encoding)