Skip to content

Commit

Permalink
[bug:1275] added check to ensure that when String.substring is called…
Browse files Browse the repository at this point in the history
… the string is long enough
  • Loading branch information
johnmay authored and egonw committed Nov 7, 2012
1 parent 0e97eff commit 5a7baa4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/org/openscience/cdk/io/cml/CMLCoreModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,11 @@ else if (att.equals("occupancy")) {
} else if ("bondStereo".equals(name)) {
for (int i = 0; i < atts.getLength(); i++) {
if (atts.getQName(i).equals("dictRef")) {
if (atts.getValue(i).startsWith("cml:"))
bondStereo.add(atts.getValue(i).substring(4));
stereoGiven=true;
String value = atts.getValue(i);
if (value.startsWith("cml:") && value.length() > 4) {
bondStereo.add(value.substring(4));
stereoGiven=true;
}
}
}
} else if ("bondType".equals(name)) {
Expand Down

0 comments on commit 5a7baa4

Please sign in to comment.