Bug 60523 - PHP 4.0.6 patch fails to address problem properly.
Summary: PHP 4.0.6 patch fails to address problem properly.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: php
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact: David Lawrence
URL: http://bugs.php.net/bug.php?id=15772
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-02-28 23:11 UTC by Adrian Chung
Modified: 2007-04-18 16:40 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-12-18 15:18:05 UTC
Embargoed:


Attachments (Terms of Use)
4.0.6 memchr logic fix. (1.33 KB, patch)
2002-03-01 15:19 UTC, Adrian Chung
no flags Details | Diff

Description Adrian Chung 2002-02-28 23:11:12 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020205

Description of problem:
The patch released by the PHP team earlier does not properly address the problem.

loc = (char *) memchr(ptr, '\n', rem)+1
if (!loc) {}

won't ever execute the if() block.

The code should simply do the first line without the increment, check the value
of loc, and then do an increment in an else {} block.

Contributed patch attached.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
Look at the code. :)

Actual Results:  It looks bad.

Expected Results:  It should have been fixed properly.

Additional info:

Rasmus at PHP has been contacted, but claims that this fix addresses a rare
segfault condition, whereas the original patch fixes the security hole.

He says that there are so many other potential segfaults in the code that they
don't see a need to fix anything but "urgent security" problems.

:)

Comment 1 Chris Ricker 2002-03-01 15:00:24 UTC
Unless I'm missing something, there's no patch attached ;-)

Comment 2 Adrian Chung 2002-03-01 15:19:56 UTC
Created attachment 47102 [details]
4.0.6 memchr logic fix.

Comment 3 Adrian Chung 2002-03-01 15:20:31 UTC
Uh, duh...  My mistake.

It's attached now. :)

Comment 4 Adrian Chung 2002-03-08 15:00:21 UTC
The attached patch is courtesy of Charlie Brady <charlieb>.

Comment 5 Joe Orton 2002-12-18 15:18:05 UTC
This was in fact fixed in the php-4.1.2-7.2.4 erratum.


Note You need to log in before you can comment on or make changes to this bug.