php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58108 works with latest CVS
Submitted: 2008-03-19 09:29 UTC Modified: 2008-04-08 14:21 UTC
From: robbie dot wilhelm at gmail dot com Assigned:
Status: Closed Package: mailparse (PECL)
PHP Version: 5.2.6 OS: gentoo
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: robbie dot wilhelm at gmail dot com
New email:
PHP Version: OS:

 

 [2008-03-19 09:29 UTC] robbie dot wilhelm at gmail dot com
Description:
------------
crash occurs, when parsing certain emails, and accessing the header. print_r (also var_dump) gives output like this:
Array
(
    [return-path] => <hollilula@jungle-world.com>
    [delivered-to] => r.wagner@20sec.net
    [received] => Array
        (
Segmentation fault

I am able to access 'return-path', 'date' etc. but on 'received' it will crash.

my workaround is to use iconv_mime_decode_headers() on a separat header string.

after more investigation... this crash happens only when mailparse functions are used in function or method context. strange...


Reproduce code:
---------------
function my_mime_parse($file){
   $mime=mailparse_msg_parse_file($file);
   $hdrs=mailparse_msg_get_part_data($mime);   
   mailparse_msg_free($mime);
   return $hdrs;
}

print_r(my_mime_parse($file));

testmail:
Return-Path: <hollilula@jungle-world.com>
Delivered-To: r.wagner@20sec.net
Received: from localhost (localhost [127.0.0.1])
        by mail.20sec.de (Postfix) with SMTP id B12588E1D9
        for <r.wagner@20sec.net>; Thu, 24 Jan 2008 01:01:46 +0100 (CET)
Received: from smtp.disko-ev.de (smtp.disko-ev.de [78.47.230.186])
        by mail.20sec.de (Postfix) with ESMTP id 77CC08E69E
        for <r.wagner@20sec.net>; Thu, 24 Jan 2008 01:01:40 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
        by smtp.disko-ev.de (Postfix) with ESMTP id 1280C3692A6
        for <r.wagner@20sec.net>; Thu, 24 Jan 2008 01:01:47 +0100 (CET)
X-Amavis-Hold: Maximum number of files (1500) exceeded at (eval 71) line 1264,
        <GEN137> line 1501.
Received: by smtp.disko-ev.de (Postfix, from userid 1000)
        id A3CD63B1EFB; Thu, 24 Jan 2008 01:01:35 +0100 (CET)
Date: Thu, 24 Jan 2008 01:01:34 +0100
From: Roger Rabbit <hlxlx@jungle-world.com>
To: r.wagner@20sec.net
Subject: pix(es)
Message-ID: <20080124000132.GA19016@jones.disko-ev.de>
MIME-Version: 1.0
User-Agent: Mutt/1.5.16 (2007-06-09)
X-DSPAM-Result: Innocent
X-DSPAM-Processed: Thu Jan 24 01:01:46 2008
X-DSPAM-Confidence: 0.9899
X-DSPAM-Probability: 0.0000
X-DSPAM-Signature: 4797d56a112601598781208
Content-Type: multipart/mixed; boundary=DSPAM_MULTIPART_EX-11260

Hi R,

schlappe 13MB sollten euren Mailserver doch nicht sprengen, oder?

N=E4chtle
H.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-19 10:08 UTC] robbie dot wilhelm at gmail dot com
had this crash with php v 5.2.5 and now with gentoo version 5.2.6 too...
 [2008-03-23 21:56 UTC] shire@php.net
I can reproduce with mailparse-2.1.3, but not with the latest CVS version.  Can you please try out the latest CVS and report your results?
 [2008-04-08 13:45 UTC] robbie dot wilhelm at gmail dot com
Yes. finally I could try the CVS version. and it works! thank 
you.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 12:01:29 2025 UTC