| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
package org.owasp.dependencycheck.analyzer; |
| 19 | |
|
| 20 | |
import java.io.FileFilter; |
| 21 | |
import java.io.UnsupportedEncodingException; |
| 22 | |
import java.net.URLEncoder; |
| 23 | |
import java.util.ArrayList; |
| 24 | |
import java.util.Collections; |
| 25 | |
import java.util.Iterator; |
| 26 | |
import java.util.List; |
| 27 | |
import java.util.ListIterator; |
| 28 | |
import java.util.Set; |
| 29 | |
import java.util.regex.Matcher; |
| 30 | |
import java.util.regex.Pattern; |
| 31 | |
import org.owasp.dependencycheck.Engine; |
| 32 | |
import org.owasp.dependencycheck.analyzer.exception.AnalysisException; |
| 33 | |
import org.owasp.dependencycheck.dependency.Dependency; |
| 34 | |
import org.owasp.dependencycheck.dependency.Identifier; |
| 35 | |
import org.owasp.dependencycheck.dependency.VulnerableSoftware; |
| 36 | |
import org.owasp.dependencycheck.utils.FileFilterBuilder; |
| 37 | |
import org.slf4j.Logger; |
| 38 | |
import org.slf4j.LoggerFactory; |
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | 7 | public class FalsePositiveAnalyzer extends AbstractAnalyzer { |
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | 1 | private static final Logger LOGGER = LoggerFactory.getLogger(FalsePositiveAnalyzer.class); |
| 51 | |
|
| 52 | |
|
| 53 | |
|
| 54 | |
|
| 55 | 1 | private static final FileFilter DLL_EXE_FILTER = FileFilterBuilder.newInstance().addExtensions("dll", "exe").build(); |
| 56 | |
|
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
private static final String ANALYZER_NAME = "False Positive Analyzer"; |
| 62 | |
|
| 63 | |
|
| 64 | |
|
| 65 | 1 | private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.POST_IDENTIFIER_ANALYSIS; |
| 66 | |
|
| 67 | |
|
| 68 | |
|
| 69 | |
|
| 70 | |
|
| 71 | |
|
| 72 | |
@Override |
| 73 | |
public String getName() { |
| 74 | 5 | return ANALYZER_NAME; |
| 75 | |
} |
| 76 | |
|
| 77 | |
|
| 78 | |
|
| 79 | |
|
| 80 | |
|
| 81 | |
|
| 82 | |
@Override |
| 83 | |
public AnalysisPhase getAnalysisPhase() { |
| 84 | 4 | return ANALYSIS_PHASE; |
| 85 | |
} |
| 86 | |
|
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
|
| 91 | |
|
| 92 | |
|
| 93 | |
|
| 94 | |
|
| 95 | |
@Override |
| 96 | |
public void analyze(Dependency dependency, Engine engine) throws AnalysisException { |
| 97 | 3 | removeJreEntries(dependency); |
| 98 | 3 | removeBadMatches(dependency); |
| 99 | 3 | removeBadSpringMatches(dependency); |
| 100 | 3 | removeWrongVersionMatches(dependency); |
| 101 | 3 | removeSpuriousCPE(dependency); |
| 102 | 3 | removeDuplicativeEntriesFromJar(dependency, engine); |
| 103 | 3 | addFalseNegativeCPEs(dependency); |
| 104 | 3 | } |
| 105 | |
|
| 106 | |
|
| 107 | |
|
| 108 | |
|
| 109 | |
|
| 110 | |
|
| 111 | |
private void removeBadSpringMatches(Dependency dependency) { |
| 112 | 3 | String mustContain = null; |
| 113 | 3 | for (Identifier i : dependency.getIdentifiers()) { |
| 114 | 3 | if ("maven".contains(i.getType())) { |
| 115 | 0 | if (i.getValue() != null && i.getValue().startsWith("org.springframework.")) { |
| 116 | 0 | final int endPoint = i.getValue().indexOf(':', 19); |
| 117 | 0 | if (endPoint >= 0) { |
| 118 | 0 | mustContain = i.getValue().substring(19, endPoint).toLowerCase(); |
| 119 | 0 | break; |
| 120 | |
} |
| 121 | |
} |
| 122 | |
} |
| 123 | 3 | } |
| 124 | 3 | if (mustContain != null) { |
| 125 | 0 | final Iterator<Identifier> itr = dependency.getIdentifiers().iterator(); |
| 126 | 0 | while (itr.hasNext()) { |
| 127 | 0 | final Identifier i = itr.next(); |
| 128 | 0 | if ("cpe".contains(i.getType()) |
| 129 | 0 | && i.getValue() != null |
| 130 | 0 | && i.getValue().startsWith("cpe:/a:springsource:") |
| 131 | 0 | && !i.getValue().toLowerCase().contains(mustContain)) { |
| 132 | 0 | itr.remove(); |
| 133 | |
|
| 134 | |
} |
| 135 | 0 | } |
| 136 | |
} |
| 137 | 3 | } |
| 138 | |
|
| 139 | |
|
| 140 | |
|
| 141 | |
|
| 142 | |
|
| 143 | |
|
| 144 | |
|
| 145 | |
|
| 146 | |
|
| 147 | |
|
| 148 | |
|
| 149 | |
|
| 150 | |
|
| 151 | |
|
| 152 | |
|
| 153 | |
|
| 154 | |
|
| 155 | |
|
| 156 | |
|
| 157 | |
@SuppressWarnings("null") |
| 158 | |
private void removeSpuriousCPE(Dependency dependency) { |
| 159 | 3 | final List<Identifier> ids = new ArrayList<Identifier>(dependency.getIdentifiers()); |
| 160 | 3 | Collections.sort(ids); |
| 161 | 3 | final ListIterator<Identifier> mainItr = ids.listIterator(); |
| 162 | 6 | while (mainItr.hasNext()) { |
| 163 | 3 | final Identifier currentId = mainItr.next(); |
| 164 | 3 | final VulnerableSoftware currentCpe = parseCpe(currentId.getType(), currentId.getValue()); |
| 165 | 3 | if (currentCpe == null) { |
| 166 | 0 | continue; |
| 167 | |
} |
| 168 | 3 | final ListIterator<Identifier> subItr = ids.listIterator(mainItr.nextIndex()); |
| 169 | 6 | while (subItr.hasNext()) { |
| 170 | 3 | final Identifier nextId = subItr.next(); |
| 171 | 3 | final VulnerableSoftware nextCpe = parseCpe(nextId.getType(), nextId.getValue()); |
| 172 | 3 | if (nextCpe == null) { |
| 173 | 0 | continue; |
| 174 | |
} |
| 175 | |
|
| 176 | 3 | if (currentCpe.getVendor().equals(nextCpe.getVendor())) { |
| 177 | 0 | if (currentCpe.getProduct().equals(nextCpe.getProduct())) { |
| 178 | |
|
| 179 | 0 | final String currentVersion = currentCpe.getVersion(); |
| 180 | 0 | final String nextVersion = nextCpe.getVersion(); |
| 181 | 0 | if (currentVersion == null && nextVersion == null) { |
| 182 | |
|
| 183 | 0 | LOGGER.debug("currentVersion and nextVersion are both null?"); |
| 184 | 0 | } else if (currentVersion == null && nextVersion != null) { |
| 185 | 0 | dependency.getIdentifiers().remove(currentId); |
| 186 | 0 | } else if (nextVersion == null && currentVersion != null) { |
| 187 | 0 | dependency.getIdentifiers().remove(nextId); |
| 188 | 0 | } else if (currentVersion.length() < nextVersion.length()) { |
| 189 | 0 | if (nextVersion.startsWith(currentVersion) || "-".equals(currentVersion)) { |
| 190 | 0 | dependency.getIdentifiers().remove(currentId); |
| 191 | |
} |
| 192 | |
} else { |
| 193 | 0 | if (currentVersion.startsWith(nextVersion) || "-".equals(nextVersion)) { |
| 194 | 0 | dependency.getIdentifiers().remove(nextId); |
| 195 | |
} |
| 196 | |
} |
| 197 | |
} |
| 198 | |
} |
| 199 | 3 | } |
| 200 | 3 | } |
| 201 | 3 | } |
| 202 | |
|
| 203 | |
|
| 204 | |
|
| 205 | 1 | public static final Pattern CORE_JAVA = Pattern.compile("^cpe:/a:(sun|oracle|ibm):(j2[ems]e|" |
| 206 | |
+ "java(_platform_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|" |
| 207 | |
+ "jdk|jre|jsse)($|:.*)"); |
| 208 | |
|
| 209 | |
|
| 210 | |
|
| 211 | |
|
| 212 | 1 | public static final Pattern CORE_JAVA_JSF = Pattern.compile("^cpe:/a:(sun|oracle|ibm):jsf($|:.*)"); |
| 213 | |
|
| 214 | |
|
| 215 | |
|
| 216 | 1 | public static final Pattern CORE_FILES = Pattern.compile("(^|/)((alt[-])?rt|jsse|jfxrt|jfr|jce|javaws|deploy|charsets)\\.jar$"); |
| 217 | |
|
| 218 | |
|
| 219 | |
|
| 220 | 1 | public static final Pattern CORE_JSF_FILES = Pattern.compile("(^|/)jsf[-][^/]*\\.jar$"); |
| 221 | |
|
| 222 | |
|
| 223 | |
|
| 224 | |
|
| 225 | |
|
| 226 | |
|
| 227 | |
private void removeJreEntries(Dependency dependency) { |
| 228 | 3 | final Set<Identifier> identifiers = dependency.getIdentifiers(); |
| 229 | 3 | final Iterator<Identifier> itr = identifiers.iterator(); |
| 230 | 7 | while (itr.hasNext()) { |
| 231 | 4 | final Identifier i = itr.next(); |
| 232 | 4 | final Matcher coreCPE = CORE_JAVA.matcher(i.getValue()); |
| 233 | 4 | final Matcher coreFiles = CORE_FILES.matcher(dependency.getFileName()); |
| 234 | 4 | if (coreCPE.matches() && !coreFiles.matches()) { |
| 235 | 0 | itr.remove(); |
| 236 | |
} |
| 237 | 4 | final Matcher coreJsfCPE = CORE_JAVA_JSF.matcher(i.getValue()); |
| 238 | 4 | final Matcher coreJsfFiles = CORE_JSF_FILES.matcher(dependency.getFileName()); |
| 239 | 4 | if (coreJsfCPE.matches() && !coreJsfFiles.matches()) { |
| 240 | 0 | itr.remove(); |
| 241 | |
} |
| 242 | 4 | } |
| 243 | 3 | } |
| 244 | |
|
| 245 | |
|
| 246 | |
|
| 247 | |
|
| 248 | |
|
| 249 | |
|
| 250 | |
|
| 251 | |
|
| 252 | |
private VulnerableSoftware parseCpe(String type, String value) { |
| 253 | 6 | if (!"cpe".equals(type)) { |
| 254 | 0 | return null; |
| 255 | |
} |
| 256 | 6 | final VulnerableSoftware cpe = new VulnerableSoftware(); |
| 257 | |
try { |
| 258 | 6 | cpe.parseName(value); |
| 259 | 0 | } catch (UnsupportedEncodingException ex) { |
| 260 | 0 | LOGGER.trace("", ex); |
| 261 | 0 | return null; |
| 262 | 6 | } |
| 263 | 6 | return cpe; |
| 264 | |
} |
| 265 | |
|
| 266 | |
|
| 267 | |
|
| 268 | |
|
| 269 | |
|
| 270 | |
|
| 271 | |
|
| 272 | |
private void removeBadMatches(Dependency dependency) { |
| 273 | 3 | final Set<Identifier> identifiers = dependency.getIdentifiers(); |
| 274 | 3 | final Iterator<Identifier> itr = identifiers.iterator(); |
| 275 | |
|
| 276 | |
|
| 277 | |
|
| 278 | |
|
| 279 | |
|
| 280 | |
|
| 281 | |
|
| 282 | |
|
| 283 | 7 | while (itr.hasNext()) { |
| 284 | 4 | final Identifier i = itr.next(); |
| 285 | |
|
| 286 | 4 | if ("cpe".equals(i.getType())) { |
| 287 | 4 | if ((i.getValue().matches(".*c\\+\\+.*") |
| 288 | 4 | || i.getValue().startsWith("cpe:/a:file:file") |
| 289 | 3 | || i.getValue().startsWith("cpe:/a:mozilla:mozilla") |
| 290 | 3 | || i.getValue().startsWith("cpe:/a:cvs:cvs") |
| 291 | 3 | || i.getValue().startsWith("cpe:/a:ftp:ftp") |
| 292 | 3 | || i.getValue().startsWith("cpe:/a:tcp:tcp") |
| 293 | 3 | || i.getValue().startsWith("cpe:/a:ssh:ssh") |
| 294 | 3 | || i.getValue().startsWith("cpe:/a:lookup:lookup")) |
| 295 | 1 | && (dependency.getFileName().toLowerCase().endsWith(".jar") |
| 296 | 1 | || dependency.getFileName().toLowerCase().endsWith("pom.xml") |
| 297 | 0 | || dependency.getFileName().toLowerCase().endsWith(".dll") |
| 298 | 0 | || dependency.getFileName().toLowerCase().endsWith(".exe") |
| 299 | 0 | || dependency.getFileName().toLowerCase().endsWith(".nuspec") |
| 300 | 0 | || dependency.getFileName().toLowerCase().endsWith(".zip") |
| 301 | 0 | || dependency.getFileName().toLowerCase().endsWith(".sar") |
| 302 | 0 | || dependency.getFileName().toLowerCase().endsWith(".apk") |
| 303 | 0 | || dependency.getFileName().toLowerCase().endsWith(".tar") |
| 304 | 0 | || dependency.getFileName().toLowerCase().endsWith(".gz") |
| 305 | 0 | || dependency.getFileName().toLowerCase().endsWith(".tgz") |
| 306 | 0 | || dependency.getFileName().toLowerCase().endsWith(".ear") |
| 307 | 0 | || dependency.getFileName().toLowerCase().endsWith(".war"))) { |
| 308 | 1 | itr.remove(); |
| 309 | 3 | } else if ((i.getValue().startsWith("cpe:/a:jquery:jquery") |
| 310 | 3 | || i.getValue().startsWith("cpe:/a:prototypejs:prototype") |
| 311 | 3 | || i.getValue().startsWith("cpe:/a:yahoo:yui")) |
| 312 | 0 | && (dependency.getFileName().toLowerCase().endsWith(".jar") |
| 313 | 0 | || dependency.getFileName().toLowerCase().endsWith("pom.xml") |
| 314 | 0 | || dependency.getFileName().toLowerCase().endsWith(".dll") |
| 315 | 0 | || dependency.getFileName().toLowerCase().endsWith(".exe"))) { |
| 316 | 0 | itr.remove(); |
| 317 | 3 | } else if ((i.getValue().startsWith("cpe:/a:microsoft:excel") |
| 318 | 3 | || i.getValue().startsWith("cpe:/a:microsoft:word") |
| 319 | 3 | || i.getValue().startsWith("cpe:/a:microsoft:visio") |
| 320 | 3 | || i.getValue().startsWith("cpe:/a:microsoft:powerpoint") |
| 321 | 3 | || i.getValue().startsWith("cpe:/a:microsoft:office") |
| 322 | 3 | || i.getValue().startsWith("cpe:/a:core_ftp:core_ftp")) |
| 323 | 0 | && (dependency.getFileName().toLowerCase().endsWith(".jar") |
| 324 | 0 | || dependency.getFileName().toLowerCase().endsWith(".ear") |
| 325 | 0 | || dependency.getFileName().toLowerCase().endsWith(".war") |
| 326 | 0 | || dependency.getFileName().toLowerCase().endsWith("pom.xml"))) { |
| 327 | 0 | itr.remove(); |
| 328 | 3 | } else if (i.getValue().startsWith("cpe:/a:apache:maven") |
| 329 | 0 | && !dependency.getFileName().toLowerCase().matches("maven-core-[\\d\\.]+\\.jar")) { |
| 330 | 0 | itr.remove(); |
| 331 | 3 | } else if (i.getValue().startsWith("cpe:/a:m-core:m-core") |
| 332 | 0 | && !dependency.getEvidenceUsed().containsUsedString("m-core")) { |
| 333 | 0 | itr.remove(); |
| 334 | 3 | } else if (i.getValue().startsWith("cpe:/a:jboss:jboss") |
| 335 | 0 | && !dependency.getFileName().toLowerCase().matches("jboss-?[\\d\\.-]+(GA)?\\.jar")) { |
| 336 | 0 | itr.remove(); |
| 337 | |
} |
| 338 | |
} |
| 339 | 4 | } |
| 340 | 3 | } |
| 341 | |
|
| 342 | |
|
| 343 | |
|
| 344 | |
|
| 345 | |
|
| 346 | |
|
| 347 | |
private void removeWrongVersionMatches(Dependency dependency) { |
| 348 | 3 | final Set<Identifier> identifiers = dependency.getIdentifiers(); |
| 349 | 3 | final Iterator<Identifier> itr = identifiers.iterator(); |
| 350 | |
|
| 351 | 3 | final String fileName = dependency.getFileName(); |
| 352 | 3 | if (fileName != null && fileName.contains("axis2")) { |
| 353 | 0 | while (itr.hasNext()) { |
| 354 | 0 | final Identifier i = itr.next(); |
| 355 | 0 | if ("cpe".equals(i.getType())) { |
| 356 | 0 | final String cpe = i.getValue(); |
| 357 | 0 | if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis:") || "cpe:/a:apache:axis".equals(cpe))) { |
| 358 | 0 | itr.remove(); |
| 359 | |
} |
| 360 | |
} |
| 361 | 0 | } |
| 362 | 3 | } else if (fileName != null && fileName.contains("axis")) { |
| 363 | 0 | while (itr.hasNext()) { |
| 364 | 0 | final Identifier i = itr.next(); |
| 365 | 0 | if ("cpe".equals(i.getType())) { |
| 366 | 0 | final String cpe = i.getValue(); |
| 367 | 0 | if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis2:") || "cpe:/a:apache:axis2".equals(cpe))) { |
| 368 | 0 | itr.remove(); |
| 369 | |
} |
| 370 | |
} |
| 371 | 0 | } |
| 372 | |
} |
| 373 | 3 | } |
| 374 | |
|
| 375 | |
|
| 376 | |
|
| 377 | |
|
| 378 | |
|
| 379 | |
|
| 380 | |
|
| 381 | |
private void addFalseNegativeCPEs(Dependency dependency) { |
| 382 | |
|
| 383 | 3 | for (final Identifier identifier : dependency.getIdentifiers()) { |
| 384 | 3 | if ("cpe".equals(identifier.getType()) && identifier.getValue() != null |
| 385 | 3 | && (identifier.getValue().startsWith("cpe:/a:oracle:opensso:") |
| 386 | 3 | || identifier.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:") |
| 387 | 3 | || identifier.getValue().startsWith("cpe:/a:sun:opensso_enterprise:") |
| 388 | 3 | || identifier.getValue().startsWith("cpe:/a:sun:opensso:"))) { |
| 389 | 0 | final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s", identifier.getValue().substring(22)); |
| 390 | 0 | final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s", identifier.getValue().substring(22)); |
| 391 | 0 | final String newCpe3 = String.format("cpe:/a:sun:opensso:%s", identifier.getValue().substring(22)); |
| 392 | 0 | final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s", identifier.getValue().substring(22)); |
| 393 | |
try { |
| 394 | 0 | dependency.addIdentifier("cpe", |
| 395 | |
newCpe, |
| 396 | 0 | String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe, "UTF-8"))); |
| 397 | 0 | dependency.addIdentifier("cpe", |
| 398 | |
newCpe2, |
| 399 | 0 | String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe2, "UTF-8"))); |
| 400 | 0 | dependency.addIdentifier("cpe", |
| 401 | |
newCpe3, |
| 402 | 0 | String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe3, "UTF-8"))); |
| 403 | 0 | dependency.addIdentifier("cpe", |
| 404 | |
newCpe4, |
| 405 | 0 | String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe4, "UTF-8"))); |
| 406 | 0 | } catch (UnsupportedEncodingException ex) { |
| 407 | 0 | LOGGER.debug("", ex); |
| 408 | 0 | } |
| 409 | |
} |
| 410 | 3 | } |
| 411 | 3 | } |
| 412 | |
|
| 413 | |
|
| 414 | |
|
| 415 | |
|
| 416 | |
|
| 417 | |
|
| 418 | |
|
| 419 | |
|
| 420 | |
private void removeDuplicativeEntriesFromJar(Dependency dependency, Engine engine) { |
| 421 | 3 | if (dependency.getFileName().toLowerCase().endsWith("pom.xml") |
| 422 | 2 | || DLL_EXE_FILTER.accept(dependency.getActualFile())) { |
| 423 | 1 | String parentPath = dependency.getFilePath().toLowerCase(); |
| 424 | 1 | if (parentPath.contains(".jar")) { |
| 425 | 0 | parentPath = parentPath.substring(0, parentPath.indexOf(".jar") + 4); |
| 426 | 0 | final Dependency parent = findDependency(parentPath, engine.getDependencies()); |
| 427 | 0 | if (parent != null) { |
| 428 | 0 | boolean remove = false; |
| 429 | 0 | for (Identifier i : dependency.getIdentifiers()) { |
| 430 | 0 | if ("cpe".equals(i.getType())) { |
| 431 | 0 | final String trimmedCPE = trimCpeToVendor(i.getValue()); |
| 432 | 0 | for (Identifier parentId : parent.getIdentifiers()) { |
| 433 | 0 | if ("cpe".equals(parentId.getType()) && parentId.getValue().startsWith(trimmedCPE)) { |
| 434 | 0 | remove |= true; |
| 435 | |
} |
| 436 | 0 | } |
| 437 | |
} |
| 438 | 0 | if (!remove) { |
| 439 | 0 | return; |
| 440 | |
} |
| 441 | 0 | } |
| 442 | 0 | if (remove) { |
| 443 | 0 | engine.getDependencies().remove(dependency); |
| 444 | |
} |
| 445 | |
} |
| 446 | |
} |
| 447 | |
|
| 448 | |
} |
| 449 | 3 | } |
| 450 | |
|
| 451 | |
|
| 452 | |
|
| 453 | |
|
| 454 | |
|
| 455 | |
|
| 456 | |
|
| 457 | |
|
| 458 | |
private Dependency findDependency(String dependencyPath, List<Dependency> dependencies) { |
| 459 | 0 | for (Dependency d : dependencies) { |
| 460 | 0 | if (d.getFilePath().equalsIgnoreCase(dependencyPath)) { |
| 461 | 0 | return d; |
| 462 | |
} |
| 463 | 0 | } |
| 464 | 0 | return null; |
| 465 | |
} |
| 466 | |
|
| 467 | |
|
| 468 | |
|
| 469 | |
|
| 470 | |
|
| 471 | |
|
| 472 | |
|
| 473 | |
private String trimCpeToVendor(String value) { |
| 474 | |
|
| 475 | 0 | final int pos1 = value.indexOf(':', 7); |
| 476 | 0 | final int pos2 = value.indexOf(':', pos1 + 1); |
| 477 | 0 | if (pos2 < 0) { |
| 478 | 0 | return value; |
| 479 | |
} else { |
| 480 | 0 | return value.substring(0, pos2); |
| 481 | |
} |
| 482 | |
} |
| 483 | |
} |