Closed ITWOI closed 4 years ago
Thanks. Good catches @ITWOI. May I ask what tool are you using to find these issues?
The first one we actually fixed recently (at least we think we have). Curious if you still see any issues with this function.
For the second one, we don't actually use this main function anymore. It was used for testing. However, I've moved the line into the try/catch, so an error will be thrown on this exception.
Hi all,
Our tool has found several potential ArrayIndexOutOfBounds bugs.
In the following code snippet (begins from line 577:
The upper bound of
(range.getStart()+i)-1
is checked but not the lower bound. In other words, it seems possible that(range.getStart()+i)-1
might be -1 ifi
is 0 andrange.getStart()
is 0.In the main method of OBOParser.java, directly access
args[0]
without checking the length ofargs
may cause ArrayIndexOutOfBounds exceptions.Thanks