From c497b61917a4e4fd09bb098bd264bf06e62db317 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 11 May 2020 13:57:17 +0200 Subject: [PATCH] Issue #4860 NPE from HttpFields Paranoid catch if sending and exception page throws an exception. Signed-off-by: Greg Wilkins --- .../java/org/eclipse/jetty/server/HttpChannel.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java index de21a050398..a1a14623f6e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java @@ -432,8 +432,17 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor abort(x); else { - _response.resetContent(); - sendResponseAndComplete(); + try + { + _response.resetContent(); + sendResponseAndComplete(); + } + catch (Throwable t) + { + if (x != t) + x.addSuppressed(t); + abort(x); + } } } finally