ASF Bugzilla – Attachment 2327 Details for
Bug 10735
[PATCH] Fixes to FormulaParser to keep it from getting index out of bounds on formulaString
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
FormulaParser fixes for getChar
FormulaParser_fixes.txt (text/plain), 1.64 KB, created by
Eric Ladner
on 2002-07-12 13:00:57 UTC
(
hide
)
Description:
FormulaParser fixes for getChar
Filename:
MIME Type:
Creator:
Eric Ladner
Created:
2002-07-12 13:00:57 UTC
Size:
1.64 KB
patch
obsolete
>Index: jakarta-poi/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java,v >retrieving revision 1.23 >diff -u -r1.23 FormulaParser.java >--- jakarta-poi/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java 6 Jul 2002 18:45:16 -0000 1.23 >+++ jakarta-poi/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java 12 Jul 2002 01:56:00 -0000 >@@ -89,6 +89,7 @@ > > private String formulaString; > private int pointer=0; >+ private int formulaLength; > > private List tokens = new java.util.Stack(); > //private Stack tokens = new java.util.Stack(); >@@ -112,11 +113,19 @@ > formulaString = formula; > pointer=0; > this.book = book; >+ formulaLength = formulaString.length(); > } > > > /** Read New Character From Input Stream */ > private void GetChar() { >+ // Check to see if we've walked off the end of the string. >+ // Just return if so and reset Look to smoething to keep >+ // SkipWhitespace from spinning >+ if (pointer == formulaLength) { >+ Look = (char)0; >+ return; >+ } > Look=formulaString.charAt(pointer++); > //System.out.println("Got char: "+Look); > } >@@ -419,8 +428,8 @@ > while (IsAddop(Look)) { > if ( Look == '+' ) Add(); > if (Look == '-') Subtract(); >- // if (Look == '*') Multiply(); >- // if (Look == '/') Divide(); >+ if (Look == '*') Multiply(); >+ if (Look == '/') Divide(); > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 10735
: 2327