php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8666 highlight_string() crashes on comments
Submitted: 2001-01-12 01:55 UTC Modified: 2001-01-12 01:56 UTC
From: rasmus@php.net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Latest CVS (12/01/2001) OS: Linux
Private report: No CVE-ID: None
 [2001-01-12 01:55 UTC] rasmus@php.net
<?highlight_string('<?
	// Test
?>');?>

---------------------------------------
zend_highlight.c(154) : Block 0x082D6A8C status:
Beginning:  	Overrun (magic=0x081DAEFC, expected=0x7312F8DC)
      End:	Unknown
---------------------------------------

Suggested fix:

Index: zend_highlight.c
===================================================================
RCS file: /repository/Zend/zend_highlight.c,v
retrieving revision 1.16
diff -u -r1.16 zend_highlight.c
--- zend_highlight.c	2000/10/29 14:35:34	1.16
+++ zend_highlight.c	2001/01/12 06:55:05
@@ -149,6 +149,7 @@
 				case T_OPEN_TAG_WITH_ECHO:
 				case T_CLOSE_TAG:
 				case T_WHITESPACE:
+				case T_COMMENT:
 					break;
 				default:
 					efree(token.value.str.val);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-12 01:56 UTC] rasmus@php.net
Sort of odd to open and close a bug, I guess.  But I wanted a record of this bug in the bug database just in case.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 22:01:29 2024 UTC