Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: [milter-greylist] DKIM and ACL syntax

2010-09-16 by John Wood

> So, now that we know line 151 isn't causing this to fail where should 
> I poke around next? It still seems that there is either a 
> misinterpreted return value or a default (pass?) is just plain 
> untouched.

Well, I think this is it. Watch what happens to priv_dkim.

(gdb) print priv->priv_dkim
$17 = (DKIM *) 0xffb6afe8
(gdb) n
809             len = strlen(name) + strlen(sep) + strlen(value) + 
strlen(crlf);
(gdb) where
#0  real_header (ctx=0x2863fb80, name=0x286f9400 "Date", 
value=0x286f9405 "Wed, 15 Sep 2010 22:05:37 -0700")
    at milter-greylist.c:809
#1  0x0804b244 in mlfi_header (ctx=0x2863fb80, header=0x286f9400 "Date", 
    value=0x286f9405 "Wed, 15 Sep 2010 22:05:37 -0700") at 
milter-greylist.c:236
#2  0x282e0f36 in st_header () from /usr/local/lib/libmilter.so.4
#3  0x282e1fd2 in mi_engine () from /usr/local/lib/libmilter.so.4
#4  0x282e3b75 in mi_worker () from /usr/local/lib/libmilter.so.4
#5  0x2813b75f in pthread_getprio () from /lib/libthr.so.3
#6  0x00000000 in ?? ()
(gdb) n
810             priv->priv_msgcount += len;
(gdb) n
812             if (priv->priv_msgcount > conf.c_maxpeek) {
(gdb) n
820             if ((h = malloc(sizeof(*h))) == NULL) {
(gdb) n
825             len = strlen(name) + strlen(sep) + strlen(value) + 
strlen(crlf);
(gdb) n
826             if ((h->h_line = malloc(len + 1)) == NULL) {
(gdb) n
830             h->h_line[0] = '\0';
(gdb) n
831             strcat(h->h_line, name);
(gdb) n
832             strcat(h->h_line, sep);
(gdb) n
833             strcat(h->h_line, value);
(gdb) n
834             strcat(h->h_line, crlf);
(gdb) n
835             h->h_len = len;
(gdb) print priv->priv_dkim
$18 = (DKIM *) 0x0

..which actually happens here:

$1 = (DKIM *) 0xffb6afe8
(gdb) n
809             len = strlen(name) + strlen(sep) + strlen(value) + 
strlen(crlf);
(gdb) print priv->priv_dkim
$2 = (DKIM *)  0x0

Name, sep, value and crlf are all sane.

This happens in the same manner in both 4.3.8 and 4.2.6, so I guess 
there is a memory leak somewhere (if strlen was busted, the OS would be 
in a world of pain). I've yet to try this on another system, so I cannot 
rule out something on FreeBSD 8.1REL being the culprit.

John

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.