mirror of
https://github.com/corda/corda.git
synced 2025-02-01 16:58:27 +00:00
Check array size before accessing
This commit is contained in:
parent
2c5aa4eead
commit
72c6577b23
@ -1,4 +1,4 @@
|
||||
gradlePluginsVersion=0.16.4
|
||||
gradlePluginsVersion=0.16.5
|
||||
kotlinVersion=1.1.4
|
||||
guavaVersion=21.0
|
||||
bouncycastleVersion=1.57
|
||||
|
@ -3,6 +3,7 @@ package net.corda.plugins
|
||||
import com.typesafe.config.*
|
||||
import net.corda.cordform.CordformNode
|
||||
import org.bouncycastle.asn1.x500.X500Name
|
||||
import org.bouncycastle.asn1.x500.RDN
|
||||
import org.bouncycastle.asn1.x500.style.BCStyle
|
||||
import org.gradle.api.Project
|
||||
import java.nio.charset.StandardCharsets
|
||||
@ -87,10 +88,13 @@ class Node extends CordformNode {
|
||||
}
|
||||
|
||||
protected void rootDir(Path rootDir) {
|
||||
def dirName
|
||||
def dirName = name
|
||||
try {
|
||||
X500Name x500Name = new X500Name(name)
|
||||
dirName = x500Name.getRDNs(BCStyle.O).getAt(0).getFirst().getValue().toString()
|
||||
RDN[] o = x500Name.getRDNs(BCStyle.O)
|
||||
if (o.length > 0) {
|
||||
dirName = o.getAt(0).getFirst().getValue().toString()
|
||||
}
|
||||
} catch(IllegalArgumentException ignore) {
|
||||
// Can't parse as an X500 name, use the full string
|
||||
dirName = name
|
||||
|
Loading…
x
Reference in New Issue
Block a user