Bug 85820

Summary: ext/sockets.c has a bug in socket_write
Product: [Retired] Red Hat Linux Reporter: Chris Chabot <chabotc>
Component: phpAssignee: Joe Orton <jorton>
Status: CLOSED ERRATA QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: medium    
Version: 9CC: jorton
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-07-03 11:46:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Chabot 2003-03-08 07:05:37 UTC
sockets.c has a bug in the param count which causes the length param to be
ignored, below is the patch that fixes it for php-4.2.3 (but the same is present
in 4.2.2). I have reported this bug upstream where they fixed it in the newer
releases (4.3.x) but redhat uses an older version, so every redhat box is still
affected. Can this patch still make it into redhat 8.1? (it's seriously
bothersome to ask every client of mine to run a custom build php because of this
bug)

--- ext/sockets.org/sockets.c   2003-03-07 06:45:07.000000000 +0100 
+++ ext/sockets/sockets.c   2003-03-07 06:45:19.000000000 +0100 
@@ -690,7 +690,7 @@
 
    ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name,
le_socket);
 
-   if (ZEND_NUM_ARGS() < 4) { 
+   if (ZEND_NUM_ARGS() < 3) { 
        length = str_len;
    }

Comment 1 Chris Chabot 2003-06-11 04:55:06 UTC
Same bug was still present in red hat 9, however it seems that rawhide is going
the php 4.3.x way. 

I reported this bug to the php dev's and the fix is present in the 4.2.3 and
4.3.x versions, so if redhat will update to those versions, no action is needed.

Is a shame this report was ignored, and a simple patch never made it to new rh
releases or erate ;-/

Comment 2 Joe Orton 2003-07-03 11:46:47 UTC
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2003-204.html