diff options
author | Richard Jones <rjones@redhat.com> | 2010-03-26 13:48:24 +0000 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2010-03-26 13:52:33 +0000 |
commit | 56feba1260955347a53bd34a37ba295770e1dc5b (patch) | |
tree | 529ce832ca67081a5d04c026424a112418f5ef51 | |
parent | 6be76b4560d30b8173a98c7c5555b2e4de57f6d9 (diff) | |
download | hivex-56feba1260955347a53bd34a37ba295770e1dc5b.tar.gz hivex-56feba1260955347a53bd34a37ba295770e1dc5b.tar.xz hivex-56feba1260955347a53bd34a37ba295770e1dc5b.zip |
hivex: Add debugging message when returning ERANGE error.
-rw-r--r-- | lib/hivex.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/hivex.c b/lib/hivex.c index 45a099d..91d3b12 100644 --- a/lib/hivex.c +++ b/lib/hivex.c @@ -727,6 +727,9 @@ get_children (hive_h *h, hive_node_h node, /* Arbitrarily limit the number of subkeys we will ever deal with. */ if (nr_subkeys_in_nk > HIVEX_MAX_SUBKEYS) { + if (h->msglvl >= 2) + fprintf (stderr, "hivex: get_children: returning ERANGE because nr_subkeys_in_nk > HIVEX_MAX_SUBKEYS (%zu > %d)\n", + nr_subkeys_in_nk, HIVEX_MAX_SUBKEYS); errno = ERANGE; goto error; } @@ -997,6 +1000,9 @@ get_values (hive_h *h, hive_node_h node, /* Arbitrarily limit the number of values we will ever deal with. */ if (nr_values > HIVEX_MAX_VALUES) { + if (h->msglvl >= 2) + fprintf (stderr, "hivex: get_values: returning ERANGE because nr_values > HIVEX_MAX_VALUES (%zu > %d)\n", + nr_values, HIVEX_MAX_VALUES); errno = ERANGE; goto error; } @@ -1195,6 +1201,9 @@ hivex_value_value (hive_h *h, hive_value_h value, /* Arbitrarily limit the length that we will read. */ if (len > HIVEX_MAX_VALUE_LEN) { + if (h->msglvl >= 2) + fprintf (stderr, "hivex_value_value: returning ERANGE because data length > HIVEX_MAX_VALUE_LEN (%zu > %d)\n", + len, HIVEX_MAX_SUBKEYS); errno = ERANGE; return NULL; } |