php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3456 php core dumps on function call
Submitted: 2000-02-11 17:20 UTC Modified: 2000-07-05 13:03 UTC
From: kiko at radiumsystems dot com dot br Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.14 OS: Linux-2.2.14
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: kiko at radiumsystems dot com dot br
New email:
PHP Version: OS:

 

 [2000-02-11 17:20 UTC] kiko at radiumsystems dot com dot br
I can reproduce this on 3.0.14 as a module and as a standalone cgi. Just run for
extra entertainment. It ocassionally explodes my Netscape too - is apache not too graceful on handling SEGVs in modules?

<?

function decode_mime_string ($string) {
global $i;
   if (eregi("=?([A-Z,0-9,-]+)?([A-Z,0-9,-]+)?([A-Z,0-9,-,=,_]+)?=", $string)) {
      if (ereg("^=?", $string)) $str = ' ' . $string;
      $coded_strings = explode(' =?', $string);
      $counter = 1;
        echo "\n\nthis is the string --$string-- and this is $i";
        var_dump($coded_strings);
        echo "\n\n";
      $string = $coded_strings[0]; /* add non encoded text that is before the encoding */
      while ($counter < sizeof($coded_strings)) {
     $elements = explode('?', $coded_strings[$counter]); /* part 0 = charset */

     /* part 1 == encoding */
     /* part 2 == encoded part */
     /* part 3 == unencoded part beginning with a = */
     /* How can we use the charset information? */

     if (eregi("Q", $elements[1])) {
        $elements[2] = str_replace('_', ' ', $elements[2]);
        $elements[2] = eregi_replace("=([A-F,0-9]{2})", "%\\1", $elements[2]);
        $string .= urldecode($elements[2]);
     } else { /* we should check for B the only valid encoding other then Q
*/
        $elements[2] = str_replace('=', '', $elements[2]);
        if ($elements[2]) { $string .= base64_decode($elements[2]); }
     }

     if (isset($elements[3]) && $elements[3] != '') {
        $elements[3] = ereg_replace("^=", '', $elements[3]);
        $string .= $elements[3];
     }
     $counter++;
      }
   }
   return $string;
}

for ( $i = 1; $i < 35 ; $i++) {
decode_mime_string("[brain] =?iso-8859-1?B?RWR1Y2Hn428g4CBEaXN04m5jaWE=?=");
}
echo "Done.";
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-05 00:59 UTC] rasmus at cvs dot php dot net
Is this still happening?
 [2000-07-05 13:03 UTC] stas at cvs dot php dot net
User reports it as fixed
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 06:01:32 2025 UTC