Bug 113128 - mail-filter/libspf2 not 64 bit safe in spf_interpret.c
Bug#: 113128 Product:  Gentoo Linux Version: unspecified Platform: AMD64
OS/Version: Linux Status: RESOLVED Severity: critical Priority: P2
Resolution: FIXED Assigned To: amd64@gentoo.org Reported By: olivier.hill@gmail.com
Component: Ebuilds
URL:  http://www.gossamer-threads.com/lists/exim/users/49225
Summary: mail-filter/libspf2 not 64 bit safe in spf_interpret.c
Keywords:  
Status Whiteboard: 
Opened: 2005-11-20 20:14 0000
Description:   Opened: 2005-11-20 20:14 0000
As reported by Carsten Koch-Mauthe, libspf2-1.2.5 is not 64 bit safe.

This can cause Exim to segfault if it was configured to use spf.

You can see the complete report at:
http://www.gossamer-threads.com/lists/spf/devel/24280?do=post_view_threaded

The solution is to simply declare the buflen variable as size_t instead of int.

I have created a patch and will try to attach it to the bug report.

Reproducible: Always
Steps to Reproduce:
emerge libspf
USE="spf" emerge exim

Start Exim and wait for some emails to come by.
Actual Results:  
Look at dmesg, you should see the following:
exim[11307]: segfault at 0000000000616000 rip 00002aaaabe25a73 rsp
00007fffffbffea8 error 6

------- Comment #1 From Olivier Hill 2005-11-20 20:16:11 0000 -------
Created an attachment (id=73276) [details]
Patch for 64 bit safety

------- Comment #2 From Olivier Hill 2005-11-20 20:19:44 0000 -------
Created an attachment (id=73277) [details]
libspf2-1.2.5-r2.ebuild

------- Comment #3 From Jakub Moc (RETIRED) 2006-08-01 10:03:31 0000 -------
Sending this amd64 way, been sitting here for ages and it concerns mainly them,
after all.

------- Comment #4 From Simon Stelling (RETIRED) 2006-09-27 04:56:22 0000 -------
thanks Olivier, patch is applied in -r2