summaryrefslogtreecommitdiff
path: root/source3/tdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/tdb')
-rw-r--r--source3/tdb/tdb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index aec546a310..eb751be32b 100644
--- a/source3/tdb/tdb.c
+++ b/source3/tdb/tdb.c
@@ -478,7 +478,8 @@ static int tdb_new_database(TDB_CONTEXT *tdb, int hash_size)
int i;
/* create the header */
- strcpy(header.magic_food, TDB_MAGIC_FOOD);
+ memset(&header, 0, sizeof(header));
+ memcpy(header.magic_food, TDB_MAGIC_FOOD, strlen(TDB_MAGIC_FOOD)+1);
header.version = TDB_VERSION;
header.hash_size = hash_size;
lseek(tdb->fd, 0, SEEK_SET);