From 4fa487a6dd7015b25d6f8e8424f3f66b0b906812 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 16 Dec 2010 13:45:41 +0000 Subject: [PATCH] Backport upstream patch to fix segfault in Hivex.value_value binding. --- ...egfault-in-Hivex.value_value-binding.patch | 25 +++++++++++++++++++ hivex.spec | 14 +++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 0001-ocaml-Fix-segfault-in-Hivex.value_value-binding.patch diff --git a/0001-ocaml-Fix-segfault-in-Hivex.value_value-binding.patch b/0001-ocaml-Fix-segfault-in-Hivex.value_value-binding.patch new file mode 100644 index 0000000..638cefc --- /dev/null +++ b/0001-ocaml-Fix-segfault-in-Hivex.value_value-binding.patch @@ -0,0 +1,25 @@ +From b2e74e79b89573b2195f359fb38f68e9b900cce2 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Thu, 16 Dec 2010 13:41:59 +0000 +Subject: [PATCH] ocaml: Fix segfault in Hivex.value_value binding. + +--- + generator/generator.ml | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/generator/generator.ml b/generator/generator.ml +index 37e5b5c..7c43f1f 100755 +--- a/generator/generator.ml ++++ b/generator/generator.ml +@@ -1873,7 +1873,7 @@ copy_type_value (const char *r, size_t len, hive_type t) + Store_field (rv, 0, v); + v = caml_alloc_string (len); + memcpy (String_val (v), r, len); +- caml_modify (&Field (rv, 1), len); ++ caml_modify (&Field (rv, 1), v); + CAMLreturn (rv); + } + +-- +1.7.3.3 + diff --git a/hivex.spec b/hivex.spec index 7734e1c..4e47045 100644 --- a/hivex.spec +++ b/hivex.spec @@ -7,14 +7,13 @@ Name: hivex Version: 1.2.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Read and write Windows Registry binary hive files Group: Development/Libraries License: LGPLv2 URL: http://libguestfs.org/ Source0: http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz -Patch0: %{name}-1.2.3-dirs.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: perl @@ -36,6 +35,12 @@ BuildRequires: libxml2-devel # the old version of libguestfs that included this library: Conflicts: libguestfs <= 1:1.0.84 +# Fix Perl directory install path. +Patch0: %{name}-1.2.3-dirs.patch + +# Fix segfault in OCaml binding of Hivex.value_value. +Patch1: 0001-ocaml-Fix-segfault-in-Hivex.value_value-binding.patch + %description Hive files are the undocumented binary blobs that Windows uses to @@ -140,7 +145,9 @@ python-%{name} contains Python bindings for %{name}. %prep %setup -q + %patch0 -p1 -b .dirs +%patch1 -p1 %build @@ -249,6 +256,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Dec 16 2010 Richard W.M. Jones - 1.2.4-2 +- Backport upstream patch to fix segfault in Hivex.value_value binding. + * Thu Dec 2 2010 Richard W.M. Jones - 1.2.4-1 - New upstream version 1.2.4. - This adds Python bindings (python-hivex subpackage).