May 8 07:44:31 mailhost freshclam[3924]: [ID 702911 mail.error] Verification: Can't allocate memory

"Can't allocate memory" is the wrong message; it's not short of memory. The problem is failure to initialise openssl by calling OpenSSL_add_all_digests() resulting in EVP_get_digestbyname() returning null.

I think it is intended to call this via cl_initialize_crypto(), except it's not called.
"__attribute__((constructor))" works, compiler tested, but not here.

I've changed the #ifdef _WIN32 around cl_initialize_crypto() to add __SunOS and freshclam works. clamd appears to work too.


Patch attached.
Please don't take this as final, it's just a hint towards the problem.



James.

--- ../original/clamd/clamd.c   2014-05-06 19:39:56.000000000 +0100
+++ clamd/clamd.c       2014-05-09 19:27:33.196293494 +0100
@@ -139,7 +139,8 @@
     sa.sa_handler = SIG_IGN;
     sigaction(SIGHUP, &sa, NULL);
     sigaction(SIGUSR2, &sa, NULL);
-#else
+#endif
+#if defined(_WIN32) || defined(__SunOS)
     cl_initialize_crypto();
 #endif
 
--- ../original/clamdscan/clamdscan.c   2014-05-06 19:39:56.000000000 +0100
+++ clamdscan/clamdscan.c       2014-05-09 19:27:33.196546750 +0100
@@ -69,7 +69,7 @@
        struct sigaction sigact;
 #endif
 
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(__SunOS)
     cl_initialize_crypto();
 #endif
 
--- ../original/freshclam/freshclam.c   2014-05-06 19:39:56.000000000 +0100
+++ freshclam/freshclam.c       2014-05-09 19:27:33.196891959 +0100
@@ -302,7 +302,7 @@
     if (check_flevel ())
         exit (FCE_INIT);
 
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(__SunOS)
     cl_initialize_crypto();
 #endif
 
--- ../original/libclamav/others.c      2014-05-06 19:42:41.000000000 +0100
+++ libclamav/others.c  2014-05-09 19:27:53.246477188 +0100
@@ -1293,7 +1293,7 @@
     engine->cb_meta = callback;
 }
 
-#if !defined(_WIN32)
+#if !defined(_WIN32) && !defined(__SunOS)
 __attribute__((constructor)) void init(void)
 {
     cl_initialize_crypto();
--- ../original/sigtool/sigtool.c       2014-05-06 19:39:56.000000000 +0100
+++ sigtool/sigtool.c   2014-05-09 19:27:33.197957626 +0100
@@ -2995,7 +2995,7 @@
     if(check_flevel())
        exit(1);
 
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(__SunOS)
     cl_initialize_crypto();
 #endif
 
_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/support/ml

Reply via email to