summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/hivex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hivex.c b/lib/hivex.c
index 860c85c..3f4c629 100644
--- a/lib/hivex.c
+++ b/lib/hivex.c
@@ -1335,7 +1335,7 @@ hivex_value_string (hive_h *h, hive_value_h value)
* (Found by Hilko Bengen in a fresh Windows XP SOFTWARE hive).
*/
size_t slen = utf16_string_len_in_bytes_max (data, len);
- if (slen > len)
+ if (slen < len)
len = slen;
char *ret = windows_utf16_to_utf8 (data, len);