Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14345 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82857 invoked by uid 1010); 11 Jan 2005 20:52:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 82806 invoked from network); 11 Jan 2005 20:52:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jan 2005 20:52:16 -0000 X-Host-Fingerprint: 211.9.230.193 mgkyb1.nw.wakwak.com FreeBSD 4.6-4.9 Received: from ([211.9.230.193:1212] helo=mgkyb1.nw.wakwak.com) by pb1.pair.com (ecelerity HEAD (r4059)) with SMTP id EE/AD-49872-E7C34E14 for ; Tue, 11 Jan 2005 15:52:15 -0500 Received: from vckyb3.nw.wakwak.com (vckyb3.nw.wakwak.com [211.9.231.144]) by mgkyb1.nw.wakwak.com (8.13.2/8.13.2/2005-01-05) with SMTP id j0BKprcr033760; Wed, 12 Jan 2005 05:51:53 +0900 (JST) (envelope-from moriyoshi@at.wakwak.com) Received: from at.wakwak.com (at.wakwak.com [211.9.230.135]) by vckyb3.nw.wakwak.com (Postfix) with ESMTP id 5CC683FE02; Wed, 12 Jan 2005 05:51:53 +0900 (JST) Received: from [192.168.0.2] (newcycle.as.wakwak.ne.jp [218.225.209.145]) by at.wakwak.com (8.13.2/8.13.2/2005-01-05) with ESMTP/inet id j0BKpoLZ019238; Wed, 12 Jan 2005 05:51:51 +0900 (JST) (envelope-from moriyoshi@at.wakwak.com) In-Reply-To: <1105363854.20278.212383668@webmail.messagingengine.com> References: <1105363854.20278.212383668@webmail.messagingengine.com> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: <80F349B2-6412-11D9-9D18-000A95CE0C62@at.wakwak.com> Content-Transfer-Encoding: 7bit Cc: jaakko.hyvatti@iki.fi, rasmus@php.net, moriyoshi@php.net, wez@thebrainroom.com, internals@lists.php.net Date: Wed, 12 Jan 2005 05:51:01 +0900 To: "Kamesh Jayachandran" X-Mailer: Apple Mail (2.619) Subject: Re: [PHP-DEV] Segmentation fault in html_entity_decode From: moriyoshi@at.wakwak.com (Moriyoshi Koizumi) Now fixed in CVS. Thanks for the good report. Moriyoshi On 2005/01/10, at 22:30, Kamesh Jayachandran wrote: > Hi All, > The following script causes a segmentation fault in NetWare but not on > Windows or Linux versions of php-5.0.3 > html_entity_decode(' ', ENT_QUOTES, 'UTF-8'); > ?> > > I can not attribute to NetWare instead I could see the defect in our > ext/standard/html.c > The cause seems to be the following arrays are accessed with a index > that is beyond their size > 1)ent_uni_spacing(Actual size is 22 but accessed with a index 22) > 2)ent_uni_8592_9002(Actual size is 410 but accessed with a index 410. > From the name it seems that 9002 is a valid index so we need to add one > more NULL at the end) > Either we should add one more entry to the ent_uni_spacing array or > reduce our endchar in entity_map > You can see the index with which this arrays are accessed by putting a > printf("k - entity_map[j].basechar = %d\n", k - > entity_map[j].basechar); > in a for loop which is around line 898 in html.c version 1.97.2.1.