summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-10-15 05:40:24 +0000
committerAndrew Tridgell <tridge@samba.org>2002-10-15 05:40:24 +0000
commit5139da0bc63163469e5e0378598cfd9b17734b0d (patch)
tree6eeec33216b37d17ae6a2f1c09a14a8229b6897b /source3/smbd
parent30acf331a982b6e2655405f8e76aaf1b30ff84fc (diff)
downloadsamba-5139da0bc63163469e5e0378598cfd9b17734b0d.tar.gz
samba-5139da0bc63163469e5e0378598cfd9b17734b0d.tar.bz2
samba-5139da0bc63163469e5e0378598cfd9b17734b0d.zip
fixed a crash bug on 64 bit systems. Thanks to Anton Blanchard for
finding this. (This used to be commit 4ba8608020123a52432e5afaa914e290e4ce8cbf)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/mangle_hash2.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c
index a0a3d51139..5adde19eea 100644
--- a/source3/smbd/mangle_hash2.c
+++ b/source3/smbd/mangle_hash2.c
@@ -147,14 +147,12 @@ static BOOL cache_init(void)
{
if (prefix_cache) return True;
- prefix_cache = malloc(sizeof(char *) * MANGLE_CACHE_SIZE);
+ prefix_cache = calloc(MANGLE_CACHE_SIZE, sizeof(char *));
if (!prefix_cache) return False;
- prefix_cache_hashes = malloc(sizeof(u32) * MANGLE_CACHE_SIZE);
+ prefix_cache_hashes = calloc(MANGLE_CACHE_SIZE, sizeof(u32));
if (!prefix_cache_hashes) return False;
- memset(prefix_cache, 0, sizeof(char *) * MANGLE_CACHE_SIZE);
- memset(prefix_cache_hashes, 0, sizeof(char *) * MANGLE_CACHE_SIZE);
return True;
}