New upstream version 1.3.12.

- Drop patches which are now upstream.
- Use OCaml macros to test if OCaml native compiler is available.
- Use autoreconf --force option.
This commit is contained in:
Richard W.M. Jones 2015-10-05 18:01:56 +01:00
parent 8077a7cf2b
commit 39cc0bf2c8
6 changed files with 15 additions and 143 deletions

View File

@ -1,33 +0,0 @@
From 4b3c3cd2b3d8d34601979feeb1390fddd442ab04 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 20 Nov 2014 21:37:19 +0000
Subject: [PATCH] lib: Don't leak errno from _hivex_recode function.
If iconv returns E2BIG, that's an internal indication for us, and not
an error. Don't leak the errno up to the user, as happened here:
https://www.redhat.com/archives/libguestfs/2014-November/msg00140.html
Thanks Nicolas Ecarnot.
---
lib/utf16.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/utf16.c b/lib/utf16.c
index fe2c3bd..238f40a 100644
--- a/lib/utf16.c
+++ b/lib/utf16.c
@@ -58,6 +58,10 @@ _hivex_recode (const char *input_encoding, const char *input, size_t input_len,
if (r == (size_t) -1) {
if (errno == E2BIG) {
int err = errno;
+ /* Reset errno here because we don't want to accidentally
+ * return E2BIG to a library caller.
+ */
+ errno = 0;
size_t prev = outalloc;
/* Try again with a larger output buffer. */
free (out);
--
2.1.0

View File

@ -1,28 +0,0 @@
From bec3f0bb632c4b84a1dfb73eb6333c2ba9834ffb Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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

View File

@ -1,33 +0,0 @@
From 62b885e5b6239ac925554063dadeff8eeee7f2fc Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 11 Nov 2014 11:36:30 +0100
Subject: [PATCH 1/2] lib: write: fix memory leak
Free the "blocks" array got from _hivex_get_children.
Thanks: Mahmoud Al-Qudsi
---
lib/write.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/write.c b/lib/write.c
index abd12c5..33b64e4 100644
--- a/lib/write.c
+++ b/lib/write.c
@@ -902,10 +902,13 @@ hivex_node_delete_child (hive_h *h, hive_node_h node)
}
}
}
+ free (blocks);
SET_ERRNO (ENOTSUP, "could not find parent to child link");
return -1;
found:;
+ free (blocks);
+
struct ntreg_nk_record *nk =
(struct ntreg_nk_record *) ((char *) h->addr + parent);
size_t nr_subkeys_in_nk = le32toh (nk->nr_subkeys);
--
2.1.0

View File

@ -1,31 +0,0 @@
From 99b613b1c1d326702b2bb527f20d555d7c7e4ee7 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 14 Nov 2014 15:37:37 +0000
Subject: [PATCH 2/2] lib: Increase HIVEX_MAX_VALUE_LEN to 8000000.
I encountered a hive that contained a key of 3_886_561 bytes length in
a key called 'HKLM\SYSTEM\ControlSet001\services\mfeavfk' (apparently
belonging to "McAfee Anti-virus software").
The previous limit was set arbitrarily at 2_000_000 bytes. Increase
it to cope with this larger key.
---
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 e59084d..1613013 100644
--- a/lib/hivex-internal.h
+++ b/lib/hivex-internal.h
@@ -325,7 +325,7 @@ extern int _hivex_get_values (hive_h *h, hive_node_h node, hive_value_h **values
/* These limits are in place to stop really stupid stuff and/or exploits. */
#define HIVEX_MAX_SUBKEYS 15000
#define HIVEX_MAX_VALUES 10000
-#define HIVEX_MAX_VALUE_LEN 2000000
+#define HIVEX_MAX_VALUE_LEN 8000000
#define HIVEX_MAX_ALLOCATION 1000000
#endif /* HIVEX_INTERNAL_H_ */
--
2.1.0

View File

@ -1,13 +1,13 @@
# conditionalize Ocaml support # Conditionalize Ocaml support. This looks ass-backwards, but it's not.
%ifarch sparc64 s390 s390x %ifarch %{ocaml_native_compiler}
%bcond_with ocaml
%else
%bcond_without ocaml %bcond_without ocaml
%else
%bcond_with ocaml
%endif %endif
Name: hivex Name: hivex
Version: 1.3.11 Version: 1.3.12
Release: 13%{?dist} Release: 1%{?dist}
Summary: Read and write Windows Registry binary hive files Summary: Read and write Windows Registry binary hive files
License: LGPLv2 License: LGPLv2
@ -19,12 +19,6 @@ Source0: http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz
Patch0: %{name}-1.3.8-dirs.patch Patch0: %{name}-1.3.8-dirs.patch
BuildRequires: autoconf, automake, libtool, gettext-devel BuildRequires: autoconf, automake, libtool, gettext-devel
# 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
Patch4: 0001-lib-Don-t-leak-errno-from-_hivex_recode-function.patch
BuildRequires: perl BuildRequires: perl
# Provides %{_bindir}/pod2html # Provides %{_bindir}/pod2html
BuildRequires: perl-Pod-Html BuildRequires: perl-Pod-Html
@ -176,11 +170,8 @@ ruby-%{name} contains Ruby bindings for %{name}.
%setup -q %setup -q
%patch0 -p1 -b .dirs %patch0 -p1 -b .dirs
autoreconf -i autoreconf -i --force
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build %build
%configure %configure
@ -287,6 +278,12 @@ rm $RPM_BUILD_ROOT%{python_sitearch}/libhivexmod.la
%changelog %changelog
* Mon Oct 5 2015 Richard W.M. Jones <rjones@redhat.com> - 1.3.12-1
- New upstream version 1.3.12.
- Drop patches which are now upstream.
- Use OCaml macros to test if OCaml native compiler is available.
- Use autoreconf --force option.
* Thu Aug 27 2015 Petr Šabata <contyk@redhat.com> - 1.3.11-13 * Thu Aug 27 2015 Petr Šabata <contyk@redhat.com> - 1.3.11-13
- Correcting the perl build time dependency list - Correcting the perl build time dependency list
Switching to virtual perl()-style symbols Switching to virtual perl()-style symbols

View File

@ -1 +1 @@
be99b2db9913eab10b9b39219cec55a9 hivex-1.3.11.tar.gz 710bfdeaf7b04e9b04269c25f654edad hivex-1.3.12.tar.gz