summaryrefslogtreecommitdiff
path: root/source4/lib/registry/local.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/registry/local.c')
-rw-r--r--source4/lib/registry/local.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source4/lib/registry/local.c b/source4/lib/registry/local.c
index 3078518539..98791743ae 100644
--- a/source4/lib/registry/local.c
+++ b/source4/lib/registry/local.c
@@ -80,6 +80,10 @@ static WERROR local_open_key(TALLOC_CTX *mem_ctx,
const char **elements = NULL;
int el;
+ if (path == NULL) {
+ return WERR_INVALID_PARAM;
+ }
+
orig = talloc_strdup(mem_ctx, path);
W_ERROR_HAVE_NO_MEMORY(orig);
curbegin = orig;
@@ -180,6 +184,10 @@ static WERROR local_create_key(TALLOC_CTX *mem_ctx,
const char **elements = NULL;
int el;
+ if (path == NULL) {
+ return WERR_INVALID_PARAM;
+ }
+
orig = talloc_strdup(mem_ctx, path);
W_ERROR_HAVE_NO_MEMORY(orig);
curbegin = orig;
@@ -240,6 +248,10 @@ static WERROR local_set_value(struct registry_key *key, const char *name,
{
struct local_key *local = (struct local_key *)key;
+ if (name == NULL) {
+ return WERR_INVALID_PARAM;
+ }
+
return hive_key_set_value(local->hive_key, name, type, data);
}
@@ -249,6 +261,10 @@ static WERROR local_get_value(TALLOC_CTX *mem_ctx,
{
const struct local_key *local = (const struct local_key *)key;
+ if (name == NULL) {
+ return WERR_INVALID_PARAM;
+ }
+
return hive_get_value(mem_ctx, local->hive_key, name, type, data);
}
@@ -269,6 +285,10 @@ static WERROR local_delete_key(TALLOC_CTX *mem_ctx, struct registry_key *key,
{
const struct local_key *local = (const struct local_key *)key;
+ if (name == NULL) {
+ return WERR_INVALID_PARAM;
+ }
+
return hive_key_del(mem_ctx, local->hive_key, name);
}
@@ -277,6 +297,10 @@ static WERROR local_delete_value(TALLOC_CTX *mem_ctx, struct registry_key *key,
{
const struct local_key *local = (const struct local_key *)key;
+ if (name == NULL) {
+ return WERR_INVALID_PARAM;
+ }
+
return hive_key_del_value(mem_ctx, local->hive_key, name);
}