Fix handling of numerical versions

This commit is contained in:
Stefan Neuhaus
2016-11-13 19:37:29 +01:00
parent 3bbc485968
commit 1337686013
2 changed files with 11 additions and 0 deletions

View File

@@ -234,6 +234,13 @@ public class VulnerableSoftware extends IndexEntry implements Serializable, Comp
if (str == null || str.isEmpty()) {
return false;
}
// numbers/versions with leading zeros should not be treated as numbers
// (e.g. when comparing "01" <-> "1")
if (str.charAt(0) == '0') {
return false;
}
for (int i = 0; i < str.length(); i++) {
final char c = str.charAt(i);
if (c < '0' || c > '9') {