From 102e44e446035bdcc7611b8b556d0e20978fbb80 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 7 Jan 2000 06:14:43 +0000 Subject: don't use strcpy (This used to be commit bf9b1328c5843eb217eff4ca05645498de2def82) --- source3/tdb/tdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3') 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); -- cgit