Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:627 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44047 invoked from network); 3 Apr 2003 06:01:16 -0000 Received: from unknown (HELO walkabout.org) (12.106.145.56) by pb1.pair.com with SMTP; 3 Apr 2003 06:01:16 -0000 Received: from [68.21.47.166] (HELO cooglewin) by walkabout.org (CommuniGate Pro SMTP 4.0.3) with ESMTP id 18799605 for internals@lists.php.net; Thu, 03 Apr 2003 00:34:15 -0500 To: Date: Thu, 3 Apr 2003 01:03:06 -0500 Message-ID: <000d01c2f9a6$b6c58300$1f01a8c0@cooglewin> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal Subject: Another GD patch From: john@coggeshall.org ("John Coggeshall") Here's another small little patch to fix imagepsextendfont() that sanity checks the $extend parameter to make sure it's greater than zero. Although less than zero "works" (i.e. it doesn't crash anything) it really shouldn't be allowed. John -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- Index: gd.c =================================================================== RCS file: /repository/php4/ext/gd/gd.c,v retrieving revision 1.261 diff -u -r1.261 gd.c --- gd.c 31 Mar 2003 08:49:19 -0000 1.261 +++ gd.c 3 Apr 2003 05:54:56 -0000 @@ -3339,6 +3325,11 @@ ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); T1_DeleteAllSizes(*f_ind); + if(Z_DVAL_PP(ext) <= 0) { + + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Second parameter %f out of range (must be > 0)", Z_DVAL_PP(ext)); + RETURN_FALSE; + }