# HG changeset patch # User Sebastien Jodogne # Date 1414413936 -3600 # Node ID 476a17cfdf42d2b41e7faddc77c253a90ca5d9b4 # Parent 97089aa85b5f3ec7f9c2b3c001a3dc10f6be3252 Fix crash when bad HTTP credentials are provided diff -r 97089aa85b5f -r 476a17cfdf42 Core/HttpServer/MongooseServer.cpp --- a/Core/HttpServer/MongooseServer.cpp Thu Oct 23 13:14:58 2014 +0200 +++ b/Core/HttpServer/MongooseServer.cpp Mon Oct 27 13:45:36 2014 +0100 @@ -409,9 +409,8 @@ } - static bool Authorize(const MongooseServer& that, - const HttpHandler::Arguments& headers, - HttpOutput& output) + static bool IsAccessGranted(const MongooseServer& that, + const HttpHandler::Arguments& headers) { bool granted = false; @@ -426,15 +425,7 @@ } } - if (!granted) - { - output.SendUnauthorized(ORTHANC_REALM); - return false; - } - else - { - return true; - } + return granted; } @@ -591,8 +582,7 @@ // Authenticate this connection - if (that->IsAuthenticationEnabled() && - !Authorize(*that, headers, output)) + if (that->IsAuthenticationEnabled() && !IsAccessGranted(*that, headers)) { output.SendUnauthorized(ORTHANC_REALM); return; diff -r 97089aa85b5f -r 476a17cfdf42 NEWS --- a/NEWS Thu Oct 23 13:14:58 2014 +0200 +++ b/NEWS Mon Oct 27 13:45:36 2014 +0100 @@ -5,6 +5,7 @@ * Sample plugin framework to serve static resources * Fix issue 21 (Microsoft Visual Studio precompiled headers) * Fix issue 22 (Error decoding multi-frame instances) +* Fix crash when bad HTTP credentials are provided Version 0.8.4 (2014/09/19)