Blob Blame History Raw
From 6a4dac0da1f318a1114363b274fcee76e73fcccf Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 22 Sep 2014 15:08:44 +0100
Subject: [PATCH 02/16] value: Set errno = 0 on non-error path in
 hivex_value_data_cell_offset (RHBZ#1145056).

hivex_value_data_cell_offset may return 0 to indicate that the data is
inline.  This is not an error return, but it was possible for errno to
have a random (non-zero) value along this path.  Explicitly set errno
= 0 on this path.

Thanks: Wei Shi
(cherry picked from commit 9763f96a1374486c7d00ea5c04b8048fe69e63f3)
---
 lib/value.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/value.c b/lib/value.c
index f222b41..aa80238 100644
--- a/lib/value.c
+++ b/lib/value.c
@@ -276,6 +276,7 @@ hivex_value_data_cell_offset (hive_h *h, hive_value_h value, size_t *len)
     /* There is no other location for the value data. */
     if (len)
       *len = 0;
+    errno = 0;
     return 0;
   } else {
     if (len)
-- 
1.8.3.1