Add SET_ERRNO macro.

This commit is contained in:
Richard W.M. Jones 2014-11-25 13:40:31 +00:00
parent c59e15a167
commit 2d51ea6670
2 changed files with 16 additions and 2 deletions

View File

@ -34,8 +34,10 @@ Patch4: %{name}-1.2.3-dirs.patch
BuildRequires: autoconf, automake, libtool
# Fix handling of invalid hive files.
Patch5: 0001-handle-Refuse-to-open-files-8192-bytes-in-size.patch
Patch6: 0002-handle-Check-that-pages-do-not-extend-beyond-the-end.patch
# The first patch adds a macro which is used by the second two patches.
Patch5: set-errno.patch
Patch6: 0001-handle-Refuse-to-open-files-8192-bytes-in-size.patch
Patch7: 0002-handle-Check-that-pages-do-not-extend-beyond-the-end.patch
%description
@ -120,6 +122,7 @@ python-%{name} contains Python bindings for %{name}.
%patch4 -p1 -b .dirs
%patch5 -p1
%patch6 -p1
%patch7 -p1
autoreconf

11
set-errno.patch Normal file
View File

@ -0,0 +1,11 @@
--- hivex-1.3.5/lib/hivex.c~ 2014-11-25 13:36:48.399066057 +0000
+++ hivex-1.3.5/lib/hivex.c 2014-11-25 13:39:13.171001085 +0000
@@ -48,6 +48,8 @@
#include "hivex-internal.h"
#include "byte_conversions.h"
+#define SET_ERRNO(v,fs,...) (errno = (v))
+
/* These limits are in place to stop really stupid stuff and/or exploits. */
#define HIVEX_MAX_SUBKEYS 15000
#define HIVEX_MAX_VALUES 10000