View | Details | Raw Unified | Return to bug 241420 | Differences between
and this patch

Collapse All | Expand All

(-)b/textproc/libxslt/Makefile (-2 / +2 lines)
Lines 3-11 Link Here
3
3
4
PORTNAME=	libxslt
4
PORTNAME=	libxslt
5
PORTVERSION=	1.1.33
5
PORTVERSION=	1.1.33
6
PORTREVISION=	1
6
CATEGORIES?=	textproc gnome
7
CATEGORIES?=	textproc gnome
7
MASTER_SITES=	http://xmlsoft.org/sources/ \
8
MASTER_SITES=	https://ftp.osuosl.org/pub/blfs/conglomeration/libxslt/
8
		https://mirror.umd.edu/xbmc/build-deps/sources/
9
DIST_SUBDIR=	gnome2
9
DIST_SUBDIR=	gnome2
10
10
11
MAINTAINER?=	gnome@FreeBSD.org
11
MAINTAINER?=	gnome@FreeBSD.org
(-)b/textproc/libxslt/files/patch-libxslt_transform.c (-18 / +29 lines)
Lines 1-18 Link Here
1
--- libxslt/transform.c.orig	2017-10-30 07:49:55 UTC
1
From ee31512213544a869418a06a819e9cb9a7346f65 Mon Sep 17 00:00:00 2001
2
From: Nick Wellnhofer <wellnhofer@aevum.de>
3
Date: Sat, 17 Aug 2019 16:51:53 +0200
4
Subject: [PATCH] Fix dangling pointer in xsltCopyText
5
6
xsltCopyText didn't reset ctxt->lasttext in some cases which could
7
lead to various memory errors in relation with CDATA sections in input
8
documents.
9
10
Found by OSS-Fuzz.
11
---
12
 libxslt/transform.c | 2 ++
13
 1 file changed, 2 insertions(+)
14
15
diff --git a/libxslt/transform.c b/libxslt/transform.c
16
index ed5afacb..477265c2 100644
17
--- libxslt/transform.c
2
+++ libxslt/transform.c
18
+++ libxslt/transform.c
3
@@ -3485,10 +3485,11 @@ xsltDocumentElem(xsltTransformContextPtr ctxt, xmlNode
19
@@ -1090,6 +1090,8 @@ xsltCopyText(xsltTransformContextPtr ctxt, xmlNodePtr target,
4
      */
20
 	    if ((copy->content = xmlStrdup(cur->content)) == NULL)
5
     if (ctxt->sec != NULL) {
21
 		return NULL;
6
 	ret = xsltCheckWrite(ctxt->sec, ctxt, filename);
22
 	}
7
-	if (ret == 0) {
23
+
8
-	    xsltTransformError(ctxt, NULL, inst,
24
+	ctxt->lasttext = NULL;
9
-		 "xsltDocumentElem: write rights for %s denied\n",
25
     } else {
10
-			     filename);
26
         /*
11
+	if (ret <= 0) {
27
 	 * normal processing. keep counters to extend the text node
12
+            if (ret == 0)
28
-- 
13
+                xsltTransformError(ctxt, NULL, inst,
29
2.23.0
14
+                     "xsltDocumentElem: write rights for %s denied\n",
30
15
+                                 filename);
16
 	    xmlFree(URL);
17
 	    xmlFree(filename);
18
 	    return;
19
- 

Return to bug 241420