]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/layout.c
tdb2: avoid writing uninitialized bytes in test/layout.c
[ccan] / ccan / tdb2 / test / layout.c
index ad775c8ad49483f4275d1fedb0bc718bd1b6e9b4..16f077198dbea011a2e9510a9b6dc1aa1b938260 100644 (file)
@@ -252,6 +252,8 @@ struct tdb_context *tdb_layout_get(struct tdb_layout *layout)
        }
 
        mem = malloc(off);
+       /* Fill with some weird pattern. */
+       memset(mem, 0x99, off);
        /* Now populate our header, cribbing from a real TDB header. */
        tdb = tdb_open(NULL, TDB_INTERNAL, O_RDWR, 0, &tap_log_attr);
        memcpy(mem, tdb->map_ptr, sizeof(struct tdb_header));