mirror of
https://github.com/corda/corda.git
synced 2024-12-19 04:57:58 +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) {
|
||||
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 true;
|
||||
|
Loading…
Reference in New Issue
Block a user