From: Michael Adam Date: Tue, 24 Feb 2009 16:30:23 +0000 (+0100) Subject: s3:registry: don't directly access key->subkeys->num_subkeys in reg_api.c X-Git-Tag: build_3.2.8_ctdb.56~53 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=1bea277b343a541e0c481f93e6200c00feff1d2c;p=obnox%2Fsamba-ctdb.git s3:registry: don't directly access key->subkeys->num_subkeys in reg_api.c Use the reg_objects api instead. Michael --- diff --git a/source/registry/reg_api.c b/source/registry/reg_api.c index bea8664f8e..6f40027c39 100644 --- a/source/registry/reg_api.c +++ b/source/registry/reg_api.c @@ -308,7 +308,7 @@ WERROR reg_enumkey(TALLOC_CTX *mem_ctx, struct registry_key *key, return err; } - if (idx >= key->subkeys->num_subkeys) { + if (idx >= regsubkey_ctr_numkeys(key->subkeys)) { return WERR_NO_MORE_ITEMS; } @@ -406,11 +406,11 @@ WERROR reg_queryinfokey(struct registry_key *key, uint32_t *num_subkeys, } max_len = 0; - for (i=0; isubkeys->num_subkeys; i++) { + for (i=0; i< regsubkey_ctr_numkeys(key->subkeys); i++) { max_len = MAX(max_len, strlen(key->subkeys->subkeys[i])); } - *num_subkeys = key->subkeys->num_subkeys; + *num_subkeys = regsubkey_ctr_numkeys(key->subkeys); *max_subkeylen = max_len; *max_subkeysize = 0; /* Class length? */ @@ -566,7 +566,7 @@ WERROR reg_deletekey(struct registry_key *parent, const char *path) if (!W_ERROR_IS_OK(err = fill_subkey_cache(key))) { goto error; } - if (key->subkeys->num_subkeys > 0) { + if (regsubkey_ctr_numkeys(key->subkeys) > 0) { err = WERR_ACCESS_DENIED; goto error; } @@ -594,7 +594,7 @@ WERROR reg_deletekey(struct registry_key *parent, const char *path) goto error; } - num_subkeys = parent->subkeys->num_subkeys; + num_subkeys = regsubkey_ctr_numkeys(parent->subkeys); if (regsubkey_ctr_delkey(parent->subkeys, name) == num_subkeys) { err = WERR_BADFILE;