PHP IMAP segfault

John Dalbec jpdalbec at ysu.edu
Wed Nov 30 17:09:09 UTC 2005


I'm getting segfaults in imap_fetch_overview in php_imap.c.  I think this is 
caused by the latest viruses sending out spam messages with corrupted headers. 
My end users are unable to read mail through IMP when they get one of these in 
their mailbox.  I guess I could have my MTA reject the messages but that doesn't 
help people who've already received one.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 8920)]
0x409ba612 in zif_imap_fetch_overview () from /usr/lib/php4/imap.so
(gdb) backtrace
#0  0x409ba612 in zif_imap_fetch_overview () from /usr/lib/php4/imap.so
#1  0x67696c61 in ?? ()
Cannot access memory at address 0x62656420

The following code looks suspicious to me:
     char address[MAILTMPLEN];
...
                     rfc822_write_address(address, env->from);
...
                     rfc822_write_address(address, env->to);

It looks like this function is from libc-client.a.  I've looked at the IMAP 
source code and fixing it (snprintf-style) looks nontrivial.  Any takers?
Thanks,
John




More information about the fedora-legacy-list mailing list