From 0c54cf208588c738488f34baaa46f8dc94f3d5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20K=C3=B6hler?= Date: Sun, 12 Jun 2022 21:48:07 +0200 Subject: [PATCH] Fixed an access violation that crashes the whole server whenever the 'ApplicationCreator function' returns a nullptr --- src/web/WebSession.C | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/web/WebSession.C b/src/web/WebSession.C index 96ac3ac4e7..224ff796b3 100644 --- a/src/web/WebSession.C +++ b/src/web/WebSession.C @@ -680,9 +680,15 @@ bool WebSession::start(WebResponse *response) { try { app_ = controller_->doCreateApplication(this).release(); - if (!app_->internalPathValid_) - if (response->responseType() == WebResponse::ResponseType::Page) - response->setStatus(404); + if (app_) { + if (!app_->internalPathValid_) { + if (response->responseType() == WebResponse::ResponseType::Page) { + response->setStatus(404); + } + } + } else { + throw WException("WebSession::start: ApplicationCreator returned a nullptr"); + } } catch (std::exception& e) { app_ = nullptr;