[Clamav-devel] Another bug with ClamAV 0.99.3 beta 1

Mark Allan markjallan at gmail.com
Mon Aug 14 09:47:11 EDT 2017


I just had another look at this today with fresh eyes and I see you've already got a static replacement of strndup for Solaris, so I've included a patch which uses the same function on macOS 10.6.8 or lower.  It relies on the appropriate  (-mmacosx-version-min=10.6) setting on the configure phase, but the chances are if anyone's compiling with 10.6 support, they probably ain't compiling on 10.6 so it's likely being supplied already.




diff -Naurw clamav-0.99.3-beta1/clamd/localserver.c clamav-0.99.3-beta1_patched/clamd/localserver.c
--- clamav-0.99.3-beta1/clamd/localserver.c	2017-07-31 19:34:32.000000000 +0100
+++ clamav-0.99.3-beta1_patched/clamd/localserver.c	2017-08-14 14:24:08.000000000 +0100
@@ -25,7 +25,7 @@
 
 #include <stdio.h>
 #include <string.h>
-#if defined(C_SOLARIS)
+#if defined(C_SOLARIS) || (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1068))
 size_t strnlen(const char *s, size_t n) __attribute__((weak));
 size_t strnlen(const char *s, size_t n)
 {



Hope that's useful.

Mark


> On 13 Aug 2017, at 10:25 pm, Mark Allan <markjallan at gmail.com> wrote:
> 
> Hi all,
> 
> Another issue with 0.99.3 beta 1.
> 
> The clamd process crashes on macOS 10.6.8 because it can't find the strndup symbol.  There are a couple of references to strndup in the source for clamd and libclamav - should these be changed to cli_strndup or am I better to include a static replacement function of strndup in the appropriate files that would only be used on 10.6 or earlier?
> 
> Thanks
> Mark
> 



More information about the clamav-devel mailing list