mail/dkim-milter -- dkim-filter seg faults on strlen(key_data) when using malloc.conf option 'S'. So, I am unable to use it unless I remove malloc options.
This fixes it. Please review and commit. Index: Makefile =================================================================== RCS file: /cvs/ports/mail/dkim-milter/Makefile,v retrieving revision 1.36 diff -u -p -r1.36 Makefile --- Makefile 11 Mar 2013 11:23:50 -0000 1.36 +++ Makefile 13 Oct 2013 22:48:24 -0000 @@ -3,7 +3,7 @@ COMMENT= DKIM milter DISTNAME= dkim-milter-2.8.3 -REVISION = 1 +REVISION = 2 CATEGORIES= mail HOMEPAGE= http://sourceforge.net/projects/dkim-milter/ Index: patches/patch-dkim-filter_dkim-filter_c =================================================================== RCS file: /cvs/ports/mail/dkim-milter/patches/patch-dkim-filter_dkim-filter_c,v retrieving revision 1.10 diff -u -p -r1.10 patch-dkim-filter_dkim-filter_c --- patches/patch-dkim-filter_dkim-filter_c 23 Jan 2009 06:43:07 -0000 1.10 +++ patches/patch-dkim-filter_dkim-filter_c 13 Oct 2013 22:48:24 -0000 @@ -1,7 +1,16 @@ $OpenBSD: patch-dkim-filter_dkim-filter_c,v 1.10 2009/01/23 06:43:07 jasper Exp $ ---- dkim-filter/dkim-filter.c.orig Tue Jan 6 19:39:08 2009 -+++ dkim-filter/dkim-filter.c Thu Jan 22 23:28:54 2009 -@@ -8906,7 +8906,7 @@ main(int argc, char **argv) +--- dkim-filter/dkim-filter.c.orig Wed May 27 12:34:05 2009 ++++ dkim-filter/dkim-filter.c Sun Oct 13 18:39:15 2013 +@@ -4872,7 +4872,7 @@ dkimf_loadkeys(char *file, struct dkimf_config *conf) + return -1; + } + +- new->key_data = malloc(s.st_size); ++ new->key_data = calloc(1, s.st_size + 1); + if (new->key_data == NULL) + { + fprintf(stderr, "%s: malloc(): %s\n", +@@ -9044,7 +9044,7 @@ main(int argc, char **argv) unsigned long tmpl; const char *args = CMDLINEOPTS; FILE *f; Index: patches/patch-libdkim_dkim_h =================================================================== RCS file: /cvs/ports/mail/dkim-milter/patches/patch-libdkim_dkim_h,v retrieving revision 1.5 diff -u -p -r1.5 patch-libdkim_dkim_h --- patches/patch-libdkim_dkim_h 23 Jan 2009 06:43:07 -0000 1.5 +++ patches/patch-libdkim_dkim_h 13 Oct 2013 22:48:24 -0000 @@ -1,7 +1,7 @@ $OpenBSD: patch-libdkim_dkim_h,v 1.5 2009/01/23 06:43:07 jasper Exp $ ---- libdkim/dkim.h.orig Tue Jan 13 09:22:18 2009 -+++ libdkim/dkim.h Thu Jan 22 23:28:54 2009 -@@ -17,6 +17,10 @@ static char dkim_h_id[] = "@(#)$Id: dkim.h,v 1.197 200 +--- libdkim/dkim.h.orig Mon Apr 6 18:36:09 2009 ++++ libdkim/dkim.h Sun Oct 13 18:28:20 2013 +@@ -17,6 +17,10 @@ static char dkim_h_id[] = "@(#)$Id: dkim.h,v 1.202 200 /* openssl includes */ #include <openssl/sha.h>
