From 409e7f0ebf3899151cb4f46e855e1e348c15742f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 20 Nov 2014 20:52:14 +0000 Subject: [PATCH] Increase HIVEX_MAX_SUBKEYS. (cherry picked from commit 7c43fb667d04ccdddb71574d4cc945890a9c3ee6) --- ...-Increase-HIVEX_MAX_SUBKEYS-to-25000.patch | 28 +++++++++++++++++++ hivex.spec | 9 ++++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 0001-lib-Increase-HIVEX_MAX_SUBKEYS-to-25000.patch diff --git a/0001-lib-Increase-HIVEX_MAX_SUBKEYS-to-25000.patch b/0001-lib-Increase-HIVEX_MAX_SUBKEYS-to-25000.patch new file mode 100644 index 0000000..f8d7fe7 --- /dev/null +++ b/0001-lib-Increase-HIVEX_MAX_SUBKEYS-to-25000.patch @@ -0,0 +1,28 @@ +From bec3f0bb632c4b84a1dfb73eb6333c2ba9834ffb Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 20 Nov 2014 20:47:50 +0000 +Subject: [PATCH] lib: Increase HIVEX_MAX_SUBKEYS to 25000. + +Thanks Nicolas Ecarnot who found a HKLM\SOFTWARE hive from a Windows +XP machine which had an nk containing 18254 subkeys ( > current limit +of 15000). +--- + lib/hivex-internal.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/hivex-internal.h b/lib/hivex-internal.h +index 1613013..1643469 100644 +--- a/lib/hivex-internal.h ++++ b/lib/hivex-internal.h +@@ -323,7 +323,7 @@ extern int _hivex_get_values (hive_h *h, hive_node_h node, hive_value_h **values + } while (0) + + /* These limits are in place to stop really stupid stuff and/or exploits. */ +-#define HIVEX_MAX_SUBKEYS 15000 ++#define HIVEX_MAX_SUBKEYS 25000 + #define HIVEX_MAX_VALUES 10000 + #define HIVEX_MAX_VALUE_LEN 8000000 + #define HIVEX_MAX_ALLOCATION 1000000 +-- +2.1.0 + diff --git a/hivex.spec b/hivex.spec index c023ed2..9141e3d 100644 --- a/hivex.spec +++ b/hivex.spec @@ -7,7 +7,7 @@ Name: hivex Version: 1.3.11 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Read and write Windows Registry binary hive files License: LGPLv2 @@ -19,9 +19,10 @@ Source0: http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz Patch0: %{name}-1.3.8-dirs.patch BuildRequires: autoconf, automake, libtool, gettext-devel -# Pull in a couple of upstream fixes. +# Pull in some upstream fixes. Patch1: 0001-lib-write-fix-memory-leak.patch Patch2: 0002-lib-Increase-HIVEX_MAX_VALUE_LEN-to-8000000.patch +Patch3: 0001-lib-Increase-HIVEX_MAX_SUBKEYS-to-25000.patch BuildRequires: perl BuildRequires: perl-Test-Simple @@ -164,6 +165,7 @@ ruby-%{name} contains Ruby bindings for %{name}. autoreconf -i %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build %configure @@ -270,6 +272,9 @@ rm $RPM_BUILD_ROOT%{python_sitearch}/libhivexmod.la %changelog +* Thu Nov 20 2014 Richard W.M. Jones - 1.3.11-3 +- Increase HIVEX_MAX_SUBKEYS. + * Fri Nov 14 2014 Richard W.M. Jones - 1.3.11-2 - Pull in a couple of upstream fixes: * Fix memory leak in _hivex_get_children.