Revision: 3926
http://svn.sourceforge.net/winmerge/?rev=3926&view=rev
Author: kimmov
Date: 2006-12-07 10:09:14 -0800 (Thu, 07 Dec 2006)
Log Message:
-----------
PATCH: [ 1556685 ] Avoid infinite loop in character loop in crystal c++ parser
- Submitted by Perry
Modified Paths:
--------------
branches/R2_6/Src/Changes.txt
branches/R2_6/Src/editlib/asp.cpp
branches/R2_6/Src/editlib/basic.cpp
branches/R2_6/Src/editlib/batch.cpp
branches/R2_6/Src/editlib/cplusplus.cpp
branches/R2_6/Src/editlib/csharp.cpp
branches/R2_6/Src/editlib/dcl.cpp
branches/R2_6/Src/editlib/fortran.cpp
branches/R2_6/Src/editlib/html.cpp
branches/R2_6/Src/editlib/innosetup.cpp
branches/R2_6/Src/editlib/is.cpp
branches/R2_6/Src/editlib/java.cpp
branches/R2_6/Src/editlib/lisp.cpp
branches/R2_6/Src/editlib/nsis.cpp
branches/R2_6/Src/editlib/pascal.cpp
branches/R2_6/Src/editlib/perl.cpp
branches/R2_6/Src/editlib/php.cpp
branches/R2_6/Src/editlib/python.cpp
branches/R2_6/Src/editlib/rexx.cpp
branches/R2_6/Src/editlib/rsrc.cpp
branches/R2_6/Src/editlib/ruby.cpp
branches/R2_6/Src/editlib/sgml.cpp
branches/R2_6/Src/editlib/sh.cpp
branches/R2_6/Src/editlib/siod.cpp
branches/R2_6/Src/editlib/sql.cpp
branches/R2_6/Src/editlib/tcl.cpp
branches/R2_6/Src/editlib/tex.cpp
branches/R2_6/Src/editlib/xml.cpp
Modified: branches/R2_6/Src/Changes.txt
===================================================================
--- branches/R2_6/Src/Changes.txt 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/Changes.txt 2006-12-07 18:09:14 UTC (rev 3926)
@@ -2,6 +2,14 @@
Add new items to top.
(This summarizes all changes to all files under Src, including Src\Languages.)
+2006-12-07 Kimmo
+ PATCH: [ 1556685 ] Avoid infinite loop in character loop in crystal c++ parser
+ Submitted by Perry
+ Src/editlib: asp.cpp basic.cpp batch.cpp cplusplus.cpp csharp.cpp dcl.cpp fortran.cpp
+ html.cpp innosetup.cpp is.cpp java.cpp lisp.cpp nsis.cpp. pascal.cpp perl.cpp php.cpp
+ python.cpp rexx.cpp rsrc.cpp ruby.cpp sgml.cpp sh.cpp siod.cpp sql.cpp tcl.cpp tex.cpp
+ xml.cpp
+
2006-12-04 Tim
PATCH: [ 1607193 ] INI Syntax Improvements
Src/editlib: ini.cpp
Modified: branches/R2_6/Src/editlib/asp.cpp
===================================================================
--- branches/R2_6/Src/editlib/asp.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/asp.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -629,6 +629,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = ::CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/basic.cpp
===================================================================
--- branches/R2_6/Src/editlib/basic.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/basic.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -299,6 +299,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = ::CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/batch.cpp
===================================================================
--- branches/R2_6/Src/editlib/batch.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/batch.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -664,6 +664,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/cplusplus.cpp
===================================================================
--- branches/R2_6/Src/editlib/cplusplus.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/cplusplus.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -273,6 +273,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/csharp.cpp
===================================================================
--- branches/R2_6/Src/editlib/csharp.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/csharp.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -197,8 +197,15 @@
int I=0;
for (I = 0;; nPrevI = I, I = ::CharNext(pszChars+I) - pszChars)
{
- if (bRedefineBlock)
+ if (I == nPrevI)
{
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
+ if (bRedefineBlock)
+ {
int nPos = I;
if (bDecIndex)
nPos = nPrevI;
Modified: branches/R2_6/Src/editlib/dcl.cpp
===================================================================
--- branches/R2_6/Src/editlib/dcl.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/dcl.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -199,6 +199,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/fortran.cpp
===================================================================
--- branches/R2_6/Src/editlib/fortran.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/fortran.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -313,6 +313,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/html.cpp
===================================================================
--- branches/R2_6/Src/editlib/html.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/html.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -459,6 +459,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/innosetup.cpp
===================================================================
--- branches/R2_6/Src/editlib/innosetup.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/innosetup.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -402,6 +402,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/is.cpp
===================================================================
--- branches/R2_6/Src/editlib/is.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/is.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -506,6 +506,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/java.cpp
===================================================================
--- branches/R2_6/Src/editlib/java.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/java.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -159,6 +159,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/lisp.cpp
===================================================================
--- branches/R2_6/Src/editlib/lisp.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/lisp.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -336,6 +336,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/nsis.cpp
===================================================================
--- branches/R2_6/Src/editlib/nsis.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/nsis.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -510,6 +510,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/pascal.cpp
===================================================================
--- branches/R2_6/Src/editlib/pascal.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/pascal.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -160,6 +160,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/perl.cpp
===================================================================
--- branches/R2_6/Src/editlib/perl.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/perl.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -330,6 +330,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/php.cpp
===================================================================
--- branches/R2_6/Src/editlib/php.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/php.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -550,6 +550,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/python.cpp
===================================================================
--- branches/R2_6/Src/editlib/python.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/python.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -248,6 +248,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/rexx.cpp
===================================================================
--- branches/R2_6/Src/editlib/rexx.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/rexx.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -187,6 +187,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/rsrc.cpp
===================================================================
--- branches/R2_6/Src/editlib/rsrc.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/rsrc.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -251,6 +251,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/ruby.cpp
===================================================================
--- branches/R2_6/Src/editlib/ruby.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/ruby.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -196,6 +196,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/sgml.cpp
===================================================================
--- branches/R2_6/Src/editlib/sgml.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/sgml.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -290,6 +290,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/sh.cpp
===================================================================
--- branches/R2_6/Src/editlib/sh.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/sh.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -155,6 +155,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = ::CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/siod.cpp
===================================================================
--- branches/R2_6/Src/editlib/siod.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/siod.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -414,6 +414,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = ::CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/sql.cpp
===================================================================
--- branches/R2_6/Src/editlib/sql.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/sql.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -147,6 +147,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = ::CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/tcl.cpp
===================================================================
--- branches/R2_6/Src/editlib/tcl.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/tcl.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -122,6 +122,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = ::CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/tex.cpp
===================================================================
--- branches/R2_6/Src/editlib/tex.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/tex.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -942,6 +942,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = ::CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
Modified: branches/R2_6/Src/editlib/xml.cpp
===================================================================
--- branches/R2_6/Src/editlib/xml.cpp 2006-12-07 16:03:38 UTC (rev 3925)
+++ branches/R2_6/Src/editlib/xml.cpp 2006-12-07 18:09:14 UTC (rev 3926)
@@ -259,6 +259,13 @@
int I=0;
for (I = 0;; nPrevI = I, I = ::CharNext(pszChars+I) - pszChars)
{
+ if (I == nPrevI)
+ {
+ // CharNext did not advance, so we're at the end of the string
+ // and we already handled this character, so stop
+ break;
+ }
+
if (bRedefineBlock)
{
int nPos = I;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|