[clamav-users] Another bug with ClamAV 0.99.3 beta 1

Steven Morgan smorgan at sourcefire.com
Mon Aug 14 17:41:11 UTC 2017


Mark,

We are in the process of reworking that strndup/strnlen test. The rework
will use feature tests during ./configure to test for the presence of the
system implementations of strndup and strnlen. The operating system test
that is currently in place for when to use the local implementations of
strnlen and strndup will be going away. Thanks for writing a patch. It
should suffice during beta.


Steve


On Mon, Aug 14, 2017 at 9:47 AM, Mark Allan <markjallan at gmail.com> wrote:

> 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
> >
>
> _______________________________________________
> clamav-users mailing list
> clamav-users at lists.clamav.net
> http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-users
>
>
> Help us build a comprehensive ClamAV guide:
> https://github.com/vrtadmin/clamav-faq
>
> http://www.clamav.net/contact.html#ml
>



More information about the clamav-users mailing list