s3:registry: add an extra check for dsize==0 to regdb_fetch_keys_internal()
authorMichael Adam <obnox@samba.org>
Mon, 2 Nov 2009 23:51:27 +0000 (00:51 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 26 Nov 2009 10:40:36 +0000 (11:40 +0100)
Don't only rely on dptr == NULL.
I stumbled over this one when rewriting some of the dbwrap_ctdb code.

Michael

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit b58c7d96528bf3aa781f76b76465699f97e8985c)

source3/registry/reg_backend_db.c

index 2cd359353717f4792da54969556ae28167ae0fd7..43963db3c29a26d451b73141f56f73157fd655b6 100644 (file)
@@ -1461,7 +1461,7 @@ static WERROR regdb_fetch_keys_internal(struct db_context *db, const char *key,
 
        value = regdb_fetch_key_internal(db, frame, key);
 
-       if (value.dptr == NULL) {
+       if (value.dsize == 0 || value.dptr == NULL) {
                DEBUG(10, ("regdb_fetch_keys: no subkeys found for key [%s]\n",
                           key));
                goto done;