[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

Török Edvin edwin at clamav.net
Sun Apr 4 01:15:07 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 261e29da344d78d7b833082d630d8000834145be
Author: Török Edvin <edwin at clamav.net>
Date:   Fri Jan 15 10:23:25 2010 +0200

    Fix bus error on Sparc.
    
    Now that we have a struct with a 64-bit int member, we need to align
    everything to 64-bits on sparc! The FRAG itself was aligned, however
    the ->fake member was at 4-bytes distance (so half the time unaligned).
    Fix this by adding a dummy 64-bit member in the union to force alignment to at
    least 64-bit.
    
    Also fix some compiler warnings from make distcheck.

diff --git a/libclamav/mpool.c b/libclamav/mpool.c
index 86f3ff2..1be63c4 100644
--- a/libclamav/mpool.c
+++ b/libclamav/mpool.c
@@ -205,13 +205,16 @@ struct MP {
 };
 
 struct FRAG {
+#ifdef CL_DEBUG
+  unsigned int magic;
+#endif
   union {
     struct FRAG *next;
     unsigned int sbits;
+    int64_t dummy_align;
+    /* needed to align to 64-bit on sparc, since pointers are 32-bit only,
+     * yet we need 64-bit alignment for struct containing int64 members */
   } u;
-#ifdef CL_DEBUG
-  unsigned int magic;
-#endif
   void *fake;
 };
 #define FRAG_OVERHEAD (offsetof(struct FRAG, fake))
diff --git a/libclamav/mpool.h b/libclamav/mpool.h
index 41d8542..d6d58cd 100644
--- a/libclamav/mpool.h
+++ b/libclamav/mpool.h
@@ -24,6 +24,7 @@
 #ifdef USE_MPOOL
 #include "cltypes.h"
 typedef struct MP mpool_t;
+struct cl_engine;
 
 mpool_t *mpool_create(void);
 void mpool_destroy(mpool_t *mpool);
diff --git a/libclamav/readdb.c b/libclamav/readdb.c
index 8c966e9..fed0145 100644
--- a/libclamav/readdb.c
+++ b/libclamav/readdb.c
@@ -72,6 +72,7 @@
 #include "bytecode.h"
 #include "bytecode_api.h"
 #include "bytecode_priv.h"
+#include "cache.h"
 #ifdef CL_THREAD_SAFE
 #  include <pthread.h>
 static pthread_mutex_t cli_ref_mutex = PTHREAD_MUTEX_INITIALIZER;

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list