• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From d18f9c1102a45b401039dd899ce7069da7a73124 Mon Sep 17 00:00:00 2001
2From: Nick Wellnhofer <wellnhofer@aevum.de>
3Date: Tue, 14 Feb 2023 13:50:46 +0100
4Subject: [PATCH] malloc-fail: Fix leak of xmlCharEncodingHandler
5
6Also free handler if its name is NULL.
7
8Found with libFuzzer, see #344.
9
10Reference:https://github.com/GNOME/libxml2/commit/d18f9c1102a45b401039dd899ce7069da7a73124
11Conflict:encoding.c
12
13---
14 encoding.c | 1 -
15 1 file changed, 1 deletion(-)
16
17diff --git a/encoding.c b/encoding.c
18index 400e860..8b98f7d 100644
19--- a/encoding.c
20+++ b/encoding.c
21@@ -2792,7 +2792,6 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
22     int i, handler_in_list = 0;
23
24     if (handler == NULL) return(-1);
25-    if (handler->name == NULL) return(-1);
26     if (handlers != NULL) {
27         for (i = 0;i < nbCharEncodingHandler; i++) {
28             if (handler == handlers[i]) {
29--
302.27.0
31
32