33d974
From 6a4dac0da1f318a1114363b274fcee76e73fcccf Mon Sep 17 00:00:00 2001
40f388
From: "Richard W.M. Jones" <rjones@redhat.com>
40f388
Date: Mon, 22 Sep 2014 15:08:44 +0100
214838
Subject: [PATCH 02/16] value: Set errno = 0 on non-error path in
40f388
 hivex_value_data_cell_offset (RHBZ#1145056).
40f388
40f388
hivex_value_data_cell_offset may return 0 to indicate that the data is
40f388
inline.  This is not an error return, but it was possible for errno to
40f388
have a random (non-zero) value along this path.  Explicitly set errno
40f388
= 0 on this path.
40f388
40f388
Thanks: Wei Shi
40f388
(cherry picked from commit 9763f96a1374486c7d00ea5c04b8048fe69e63f3)
40f388
---
40f388
 lib/value.c | 1 +
40f388
 1 file changed, 1 insertion(+)
40f388
40f388
diff --git a/lib/value.c b/lib/value.c
40f388
index f222b41..aa80238 100644
40f388
--- a/lib/value.c
40f388
+++ b/lib/value.c
40f388
@@ -276,6 +276,7 @@ hivex_value_data_cell_offset (hive_h *h, hive_value_h value, size_t *len)
40f388
     /* There is no other location for the value data. */
40f388
     if (len)
40f388
       *len = 0;
40f388
+    errno = 0;
40f388
     return 0;
40f388
   } else {
40f388
     if (len)
40f388
-- 
33d974
1.8.3.1
40f388