Displaying 9 results from an estimated 9 matches for "recoded_name_len".
2013 Nov 25
3
Re: [PATCH 3/3] lib: Add support for creating nodes (keys) and values with UTF-16LE-encoded names
...+), 15 deletions(-)
>
> diff --git a/lib/write.c b/lib/write.c
> index dbb8292..72b1f8a 100644
> --- a/lib/write.c
> +++ b/lib/write.c
> @@ -608,9 +608,17 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name)
> return 0;
> }
>
> + size_t recoded_name_len;
> + int use_utf16 = 0;
> + char* recoded_name = _hivex_encode_string (name, &recoded_name_len, &use_utf16);
> + if (recoded_name == NULL) {
> + SET_ERRNO (EINVAL, "malformed name");
> + return 0;
> + }
> +
> /* Create the new nk-record. */
>...
2013 Nov 25
1
[PATCH 3/3, take 2] lib: Add support for creating nodes (keys) and values with UTF-16LE-encoded names
...+++---------------
1 file changed, 35 insertions(+), 15 deletions(-)
diff --git a/lib/write.c b/lib/write.c
index dbb8292..8c4dd8e 100644
--- a/lib/write.c
+++ b/lib/write.c
@@ -608,9 +608,17 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name)
return 0;
}
+ size_t recoded_name_len;
+ int use_utf16 = 0;
+ char* recoded_name = _hivex_encode_string (name, &recoded_name_len, &use_utf16);
+ if (recoded_name == NULL) {
+ SET_ERRNO (EINVAL, "malformed name");
+ return 0;
+ }
+
/* Create the new nk-record. */
static const char nk_id[2] = { 'n...
2013 Nov 24
4
[PATCH 1/3] lib: Further generalize iconv wrapper function.
---
lib/hivex-internal.h | 8 +++++---
lib/utf16.c | 11 +++++++----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/lib/hivex-internal.h b/lib/hivex-internal.h
index 4135f58..64fd49a 100644
--- a/lib/hivex-internal.h
+++ b/lib/hivex-internal.h
@@ -268,11 +268,13 @@ extern size_t * _hivex_return_offset_list (offset_list *list);
extern void _hivex_print_offset_list
2013 Nov 24
0
[PATCH 3/3] lib: Add support for creating nodes (keys) and values with UTF-16LE-encoded names
...+++---------------
1 file changed, 34 insertions(+), 15 deletions(-)
diff --git a/lib/write.c b/lib/write.c
index dbb8292..72b1f8a 100644
--- a/lib/write.c
+++ b/lib/write.c
@@ -608,9 +608,17 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name)
return 0;
}
+ size_t recoded_name_len;
+ int use_utf16 = 0;
+ char* recoded_name = _hivex_encode_string (name, &recoded_name_len, &use_utf16);
+ if (recoded_name == NULL) {
+ SET_ERRNO (EINVAL, "malformed name");
+ return 0;
+ }
+
/* Create the new nk-record. */
static const char nk_id[2] = { 'n...
2013 Nov 25
0
Re: [PATCH 3/3] lib: Add support for creating nodes (keys) and values with UTF-16LE-encoded names
* Richard W.M. Jones:
>> - nk->name_len = htole16 (strlen (name));
>> - strcpy (nk->name, name);
>> + nk->name_len = htole16 (recoded_name_len);
>> + memcpy (nk->name, recoded_name, recoded_name_len);
>> + free(recoded_name);
>
> Please put spaces after function names! It improves readability:
Sorry, I'll fix those. I also forgot to add a free() in
hivex_node_set_values.
>> /* Update max_subkey_name_...
2018 Feb 09
3
[PATCH] Add a cache for iconv_t handles to hive_t
...t[nr_strings] = NULL;
if (ret[nr_strings-1] == NULL) {
_hivex_free_strings (ret);
diff --git a/lib/write.c b/lib/write.c
index 33b64e4..70105c9 100644
--- a/lib/write.c
+++ b/lib/write.c
@@ -610,7 +610,7 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name)
size_t recoded_name_len;
int use_utf16 = 0;
char *recoded_name =
- _hivex_encode_string (name, &recoded_name_len, &use_utf16);
+ _hivex_encode_string (h, name, &recoded_name_len, &use_utf16);
if (recoded_name == NULL) {
SET_ERRNO (EINVAL, "malformed name");
return 0;
@@ -...
2018 Feb 09
0
Re: [PATCH] Add a cache for iconv_t handles to hive_t
...nr_strings-1] == NULL) {
> _hivex_free_strings (ret);
> diff --git a/lib/write.c b/lib/write.c
> index 33b64e4..70105c9 100644
> --- a/lib/write.c
> +++ b/lib/write.c
> @@ -610,7 +610,7 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name)
> size_t recoded_name_len;
> int use_utf16 = 0;
> char *recoded_name =
> - _hivex_encode_string (name, &recoded_name_len, &use_utf16);
> + _hivex_encode_string (h, name, &recoded_name_len, &use_utf16);
> if (recoded_name == NULL) {
> SET_ERRNO (EINVAL, "malformed na...
2018 Feb 09
2
[PATCH] Add a cache for iconv_t handles to hive_t
...t[nr_strings] = NULL;
if (ret[nr_strings-1] == NULL) {
_hivex_free_strings (ret);
diff --git a/lib/write.c b/lib/write.c
index 33b64e4..70105c9 100644
--- a/lib/write.c
+++ b/lib/write.c
@@ -610,7 +610,7 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name)
size_t recoded_name_len;
int use_utf16 = 0;
char *recoded_name =
- _hivex_encode_string (name, &recoded_name_len, &use_utf16);
+ _hivex_encode_string (h, name, &recoded_name_len, &use_utf16);
if (recoded_name == NULL) {
SET_ERRNO (EINVAL, "malformed name");
return 0;
@@ -...
2013 Dec 31
2
[PATCH 1/2] lib: write: Remove unused variable.
...c
@@ -954,7 +954,6 @@ hivex_node_set_values (hive_h *h, hive_node_h node,
for (i = 0; i < nr_values; ++i) {
/* Allocate vk record to store this (key, value) pair. */
static const char vk_id[2] = { 'v', 'k' };
- size_t name_len = strlen (values[i].key);
size_t recoded_name_len;
int use_utf16;
char* recoded_name = _hivex_encode_string (values[i].key, &recoded_name_len,
--
1.8.4.2