RE: OpenDKIM 2.5.1 Crashes On Certain Messages

From: Murray S. Kucherawy <msk_at_cloudmark.com>
Date: Mon, 2 Apr 2012 04:41:47 +0000

> -----Original Message-----
> From: opendkim-users-bounce_at_lists.opendkim.org [mailto:opendkim-users-bounce_at_lists.opendkim.org] On Behalf Of John Merriam
> Sent: Sunday, April 01, 2012 6:16 AM
> To: opendkim-users_at_lists.opendkim.org
> Subject: Re: OpenDKIM 2.5.1 Crashes On Certain Messages
>
> Your patch seems to work as well. It looks a little nicer when
> browsing the code. I'm not entirely sure it's what you want to do
> though.
>
> In your patch you moved domain = dkim_getdomain() outside the if (conf-
> >conf_localadsp_db != NULL) {} which means you are calling
> dkim_getdomain() unnecessarily when LocalADSP is not set in the .conf.
> Not a big deal I guess, but you might or might not want to do that.

I'm not too concerned with the cost of retrieving a pointer from inside an opaque data structure, which is all that function does. But in the interests of preserving your efficiency, I'll do this instead:

if (conf->conf_localadsp_db != NULL)
{
        u_char *domain;

        domain = dkim_getdomain(dfc->mctx_dkimv);

        if (domain != NULL &&
            dkimf_local_adsp(conf, (char *) domain,
                             &dfc->mctx_pcode))
        {
                pstatus = DKIM_STAT_OK;
                policydone = TRUE;
                localadsp = TRUE;
                localresult = DKIM_PRESULT_FOUND;
        }
}

How's that?

-MSk
Received on Mon Apr 02 2012 - 04:41:55 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:20:38 PST