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)
committerMichael Adam <obnox@samba.org>
Tue, 3 Nov 2009 00:02:39 +0000 (01:02 +0100)
Don't only rely on dptr == NULL.
I stumbled over this one when rewriting some of the dbwrap_ctdb code.

Michael

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;