mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix crash in HTTPServer when processing invalid request
This commit is contained in:
parent
79e3d1c5f9
commit
312506a41b
1 changed files with 7 additions and 1 deletions
|
@ -72,7 +72,9 @@ Request::Request(int fd)
|
|||
Request::~Request() {
|
||||
Close();
|
||||
|
||||
_assert_(in_->Empty());
|
||||
if (!in_->Empty()) {
|
||||
ERROR_LOG(IO, "Input not empty - invalid request?");
|
||||
}
|
||||
delete in_;
|
||||
if (!out_->Empty()) {
|
||||
ERROR_LOG(IO, "Output not empty - connection abort?");
|
||||
|
@ -330,6 +332,10 @@ void Server::HandleRequest(const Request &request) {
|
|||
}
|
||||
|
||||
void Server::HandleRequestDefault(const Request &request) {
|
||||
if (request.resource() == nullptr) {
|
||||
fallback_(request);
|
||||
return;
|
||||
}
|
||||
// First, look through all handlers. If we got one, use it.
|
||||
auto handler = handlers_.find(request.resource());
|
||||
if (handler != handlers_.end()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue