mirror of
https://github.com/corda/corda.git
synced 2025-05-31 22:50:53 +00:00
NOTICK: Fix potential infinite loop when a SecurityManager is installed. (#5993)
This commit is contained in:
parent
b3ca720412
commit
d2568b9077
@ -86,7 +86,10 @@ class SharedMemoryIncremental extends PortAllocation {
|
|||||||
|
|
||||||
private boolean isLocalPortAvailable(Long portToTest) {
|
private boolean isLocalPortAvailable(Long portToTest) {
|
||||||
try (ServerSocket serverSocket = new ServerSocket(Math.toIntExact(portToTest))) {
|
try (ServerSocket serverSocket = new ServerSocket(Math.toIntExact(portToTest))) {
|
||||||
} catch (Exception e) {
|
} catch (IOException e) {
|
||||||
|
// Don't catch anything other than IOException here in case we
|
||||||
|
// accidentally create an infinite loop. For example, installing
|
||||||
|
// a SecurityManager could throw AccessControlException.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user