summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/registry/local.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/lib/registry/local.c b/source4/lib/registry/local.c
index 98791743ae..79c398b68a 100644
--- a/source4/lib/registry/local.c
+++ b/source4/lib/registry/local.c
@@ -80,7 +80,7 @@ static WERROR local_open_key(TALLOC_CTX *mem_ctx,
const char **elements = NULL;
int el;
- if (path == NULL) {
+ if (path == NULL || path[0] == '\0') {
return WERR_INVALID_PARAM;
}
@@ -103,7 +103,7 @@ static WERROR local_open_key(TALLOC_CTX *mem_ctx,
el = 0;
}
- while (curbegin != NULL && *curbegin) {
+ do {
if (curend != NULL)
*curend = '\0';
elements = talloc_realloc(mem_ctx, elements, const char *, el+2);
@@ -124,7 +124,7 @@ static WERROR local_open_key(TALLOC_CTX *mem_ctx,
break;
curbegin = curend + 1;
curend = strchr(curbegin, '\\');
- }
+ } while (curbegin != NULL && curbegin[0] != '\0');
talloc_free(orig);
*result = reg_import_hive_key(local_parent->global.context, curkey,
@@ -184,7 +184,7 @@ static WERROR local_create_key(TALLOC_CTX *mem_ctx,
const char **elements = NULL;
int el;
- if (path == NULL) {
+ if (path == NULL || path[0] == '\0') {
return WERR_INVALID_PARAM;
}
@@ -207,7 +207,7 @@ static WERROR local_create_key(TALLOC_CTX *mem_ctx,
el = 0;
}
- while (curbegin != NULL && *curbegin) {
+ do {
if (curend != NULL)
*curend = '\0';
elements = talloc_realloc(mem_ctx, elements, const char *, el+2);
@@ -233,7 +233,7 @@ static WERROR local_create_key(TALLOC_CTX *mem_ctx,
break;
curbegin = curend + 1;
curend = strchr(curbegin, '\\');
- }
+ } while (curbegin != NULL && curbegin[0] != '\0');
talloc_free(orig);
*result = reg_import_hive_key(local_parent->global.context, curkey,