Mailing List Archive

milter-greylist with libspf2 segfaults on amd64 systems
Carsten Koch-Mauthe reports this error on 2005-10-04 17:56:09 see

http://article.gmane.org/gmane.mail.spam.spf.devel/709/match=segfault

Now i see the same situation on a amd64 system. Sendmail,
milter-greylist and libspf2 (1.2.5):

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1124096352 (LWP 5648)]
0x00002aaaab19d2a0 in memset () from /lib/libc.so.6
(gdb) bt
#0 0x00002aaaab19d2a0 in memset () from /lib/libc.so.6
#1 0x00002aaaaabcc5c2 in SPF_record_expand_data () from /usr/lib/libspf2.so.2
#2 0x00002aaaaabcccb7 in SPF_record_expand_data () from /usr/lib/libspf2.so.2
#3 0x00002aaaaabcceb6 in SPF_request_get_exp () from /usr/lib/libspf2.so.2
#4 0x00002aaaaabcdd6f in SPF_i_done () from /usr/lib/libspf2.so.2
#5 0x00002aaaaabcedf6 in SPF_record_interpret () from /usr/lib/libspf2.so.2
#6 0x00002aaaaabd1525 in SPF_request_is_loopback () from
/usr/lib/libspf2.so.2
#7 0x00002aaaaabd15cf in SPF_request_query_mailfrom () from
/usr/lib/libspf2.so.2
#8 0x000000000040cb75 in ?? ()
#9 0x0000000000403208 in ?? ()
#10 0x00002aaaab02273d in st_sender (g=0x43005140) at engine.c:853
#11 0x00002aaaab021bbe in mi_engine (ctx=0x547f30) at engine.c:355
#12 0x00002aaaab023b1f in mi_handle_session (ctx=0x547f30) at handler.c:45
#13 0x00002aaaab0228d9 in mi_thread_handle_wrapper (arg=0x549e40) at
listener.c:566
#14 0x00002aaaaaf0d0fa in start_thread () from /lib/libpthread.so.0
#15 0x00002aaaab1f2ce2 in clone () from /lib/libc.so.6
#16 0x0000000000000000 in ?? ()
(gdb)



Based on Carsten Koch-Mauthe report, i created the following patch:

--- src/libspf2/spf_interpret.c.orig 2006-10-13 16:47:29.000000000 +0200
+++ src/libspf2/spf_interpret.c 2006-10-13 16:48:16.000000000 +0200
@@ -49,8 +49,8 @@
SPF_record_t *spf_record;
SPF_errcode_t err;
char *buf;
- int buflen;
- int len;
+ size_t buflen;
+ size_t len;

SPF_ASSERT_NOTNULL(spf_response);
spf_request = spf_response->spf_request;


With this modifications, the milter-greylist doesn't segfaults anymore.

Regards
Herbert Straub

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com