• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 33264f08a089667a6b69f9ba019e8c3f0bb36d39 Mon Sep 17 00:00:00 2001
2From: Nick Wellnhofer <wellnhofer@aevum.de>
3Date: Wed, 2 Nov 2022 16:11:00 +0100
4Subject: [PATCH 10/28] malloc-fail: Fix memory leak in xmlParseReference
5
6Found with libFuzzer, see #344.
7
8Reference: https://github.com/GNOME/libxml2/commit/afc7e3a7f41e2e29ac36d4d7cbd0c0755558fa5d
9Conflict: NA
10---
11 parser.c | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/parser.c b/parser.c
15index 780a8b3..334a0aa 100644
16--- a/parser.c
17+++ b/parser.c
18@@ -7463,8 +7463,8 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
19 			    firstChild = cur;
20 			}
21 			xmlAddChild((xmlNodePtr) ent, nw);
22-			xmlAddChild(ctxt->node, cur);
23 		    }
24+		    xmlAddChild(ctxt->node, cur);
25 		    if (cur == last)
26 			break;
27 		    cur = next;
28--
292.27.0
30
31