From 8da77397286b8266b29f10a940a6905cc905dab8 Mon Sep 17 00:00:00 2001 From: loki Date: Thu, 23 Jan 2020 20:31:04 +0100 Subject: [PATCH] Fix crashing when not waiting for pin, yet /pin is called --- sunshine/nvhttp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sunshine/nvhttp.cpp b/sunshine/nvhttp.cpp index 2138ab03..cad3d516 100644 --- a/sunshine/nvhttp.cpp +++ b/sunshine/nvhttp.cpp @@ -391,6 +391,12 @@ void pin(std::shared_ptr::Response> response, pt::ptree tree; + if(map_id_sess.empty()) { + response->write(SimpleWeb::StatusCode::client_error_im_a_teapot); + + return; + } + auto &sess = std::begin(map_id_sess)->second; getservercert(sess, tree, request->path_match[1]);