#19907 [Com]: Segmentation fault during FETCH command

From: Date: Tue, 22 Oct 2002 12:06:42 +0000
Subject: #19907 [Com]: Segmentation fault during FETCH command
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-23026@lists.php.net to get a copy of this message
ID: 19907 Comment by: jonfray@mediation-telecom.net Reported By: jonfray@mediation-telecom.com Status: Closed Bug Type: IMAP related Operating System: GNU/Linux 2.4.9-34smp PHP Version: 4.2.3 New Comment: As this bug is not fixed in php4-STABLE (only in php4-LATEST) here is a patch I made to correct this bug : --- COPY START --- [jonfray@localhost php-4.2.3]$ diff ext/imap/php_imap.c.old ext/imap/php_imap.c 60a61 > #define PHP_IMAP_ADDRESS_SIZE_BUF 10 3592c3593 < int ret=0; --- > int ret=0, num_ent=0; 3600a3602 > num_ent++; 3604c3606 < ret += (ret) ? MAILTMPLEN : 0; --- > ret += (ret) ? num_ent*PHP_IMAP_ADDRESS_SIZE_BUF : 0; --- COPY STOP --- And it works ! Previous Comments: ------------------------------------------------------------------------ [2002-10-14 13:03:48] iliaa@php.net This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. The crash occured due to the old code not being able to handle emails where there were more then 100 or so 'To:' headers. ------------------------------------------------------------------------ [2002-10-14 12:58:41] jonfray@mediation-telecom.com If a mail has a very very long Header (From field for example) Apache get killed and this kind of entry is added to the logfile : [Mon Oct 14 19:27:05 2002] [notice] child pid 29327 exit signal Segmentation fault (11) I know that the Header fields are normaly limited (1024 I think) in the IMAP RFC but extra chars should be skiped (if any) thanks ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19907&edit=1

« previous php.bugs (#23026) next »