php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28692 Bogus character in PCRE + Safemode + WWW-authenticate header error
Submitted: 2004-06-08 11:52 UTC Modified: 2004-06-08 15:23 UTC
From: jg at b-one dot net Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4CVS-2004-06-08 (stable) OS: Linux (Debian)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
14 + 43 = ?
Subscribe to this entry?

 
 [2004-06-08 11:52 UTC] jg at b-one dot net
Description:
------------
A bogus character (a nul before \r\n)  is returned from 
header('WWW-Authenticate: Basic realm="ABC"');

Which causes mod_fcgi to "internal server error".

It only happens with safemode and pcre-regexp


Reproduce code:
---------------
<?

header("HTTP/1.1 401 Unauthorized");
header("WWW-Authenticate: Basic realm=\"ABC\"");

?>


Expected result:
----------------
"In emacs display" 

Status: 401^M
Content-type: text/html^M
X-Powered-By: PHP/4.3.7^M
WWW-Authenticate: Basic realm="ABC-1000"^M
^M






Actual result:
--------------
Status: 401^M
Content-type: text/html^M
X-Powered-By: PHP/4.3.7^M
WWW-Authenticate: Basic realm="ABC-1000"^@^M
^M

Notice ^@ in output.

Hexdump of last part.
3130 3030 2200 0d0a 0d0a
1000" NULL \r\n\r\n

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-08 15:23 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC