mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-1693 protect against NPE with BlockStreamServer
This commit is contained in:
@@ -315,11 +315,12 @@ public class BlockStreamServer extends Thread {
|
||||
}
|
||||
else if (!(e instanceof EOFException)) { // silent on closed connection
|
||||
log.error("file block stream failed from " + socket.getInetAddress() + ": " +
|
||||
e.getMessage());
|
||||
e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
if (!success && (registration.blockStream instanceof InputBlockStream)) {
|
||||
if (!success && (registration != null) &&
|
||||
(registration.blockStream instanceof InputBlockStream)) {
|
||||
// ensure input stream is closed since it can be terminated by client,
|
||||
// let client handle error if any
|
||||
try {
|
||||
@@ -337,7 +338,9 @@ public class BlockStreamServer extends Thread {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
registration.state = HandlerConnectionState.CLOSED;
|
||||
if (registration != null) {
|
||||
registration.state = HandlerConnectionState.CLOSED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user