s3: Fix the registry upgrade code
authorVolker Lendecke <vl@samba.org>
Thu, 28 Oct 2010 13:30:21 +0000 (15:30 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 28 Oct 2010 13:50:14 +0000 (15:50 +0200)
The strings have the 0-terminator as part of the keys. The rest of the registry
code would not cope well without.

source3/registry/reg_backend_db.c

index 43fe374505f980a68ba9ea8a03c4c19b608a08fa..489a69ee66b470e6b052afd917cc60edb585f06b 100644 (file)
@@ -420,7 +420,7 @@ static int regdb_normalize_keynames_fn(struct db_record *rec,
                new_rec.value.dptr = rec->value.dptr;
                new_rec.value.dsize = rec->value.dsize;
                new_rec.key.dptr = (unsigned char *) keyname;
-               new_rec.key.dsize = strlen(keyname);
+               new_rec.key.dsize = strlen(keyname)+1;
                new_rec.private_data = rec->private_data;
 
                /* Delete the original record and store the normalized key */