|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37920 Hardcoded ASCII values in cgi_main.c
Submitted: 2006-06-26 21:23 UTC Modified: 2006-06-27 08:28 UTC
From: agiorgio at optonline dot net Assigned:
Status: Closed Package: *Compile Issues
PHP Version: 5.1.5CVS OS: z/OS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: agiorgio at optonline dot net
New email:
PHP Version: OS:


 [2006-06-26 21:23 UTC] agiorgio at optonline dot net
There are hardcoded ASCII values in cgi_main.c.  0x10 should be '\n' and 0x13 should be '\r'.

Reproduce code:
while (c != 10 && c != 13) {
	c = fgetc(file_handle.handle.fp);	/* skip to end of line */
/* handle situations where line is terminated by \r\n */
if (c == 13) {
	if (fgetc(file_handle.handle.fp) != 10) {
		long pos = ftell(file_handle.handle.fp);
		fseek(file_handle.handle.fp, pos - 1, SEEK_SET);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-26 21:36 UTC]
You forgot to explain what the problem is.
 [2006-06-26 23:22 UTC] agiorgio at optonline dot net
This code does not compile correctly on non-ASCII systems, like IBM z/OS.
 [2006-06-27 08:28 UTC]
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
Thank you for the report, and for helping us make PHP better.

Fix committed to 5_2 and HEAD.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Feb 07 05:03:43 2023 UTC