From 7a50f089e0ae70ec7652575e11fbf87a9f6a86e7 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 25 Feb 2013 17:16:45 +0100 Subject: s4-libregistry: Improve NULL handling of name. Reviewed-by: David Disseldorp --- source4/lib/registry/regf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source4/lib/registry') diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c index 06476b940e..544dbb0b1c 100644 --- a/source4/lib/registry/regf.c +++ b/source4/lib/registry/regf.c @@ -1892,13 +1892,14 @@ static WERROR regf_set_value(struct hive_key *key, const char *name, /* If it's new, create the vk struct, if it's old, free the old data. */ if (old_vk_offset == -1) { vk.header = "vk"; - vk.name_length = strlen(name); - if (name != NULL && name[0] != 0) { + if (name != NULL && name[0] != '\0') { vk.flag = 1; vk.data_name = name; + vk.name_length = strlen(name); } else { - vk.data_name = NULL; vk.flag = 0; + vk.data_name = NULL; + vk.name_length = 0; } } else { /* Free data, if any */ -- cgit