git.samba.org
/
gd
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
112faa4
)
don't use strcpy
author
Andrew Tridgell
<tridge@samba.org>
Fri, 7 Jan 2000 06:14:43 +0000
(06:14 +0000)
committer
Andrew Tridgell
<tridge@samba.org>
Fri, 7 Jan 2000 06:14:43 +0000
(06:14 +0000)
(This used to be commit
bf9b1328c5843eb217eff4ca05645498de2def82
)
source3/tdb/tdb.c
patch
|
blob
|
history
diff --git
a/source3/tdb/tdb.c
b/source3/tdb/tdb.c
index aec546a31081ec74803a1801e0ffda49be054e0f..eb751be32b53174d170fc16d698212982edc0351 100644
(file)
--- 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);