CLOUD: Fix crash on HTTP request with unparsed path
Occurred during an nmap scan. Fixes bug #12997
This commit is contained in:
parent
85f1c96fb5
commit
7468a2e17f
1 changed files with 5 additions and 2 deletions
|
@ -54,10 +54,13 @@ const char *ResourceHandler::determineMimeType(Common::String &filename) {
|
||||||
|
|
||||||
void ResourceHandler::handle(Client &client) {
|
void ResourceHandler::handle(Client &client) {
|
||||||
Common::String filename = client.path();
|
Common::String filename = client.path();
|
||||||
filename.deleteChar(0);
|
|
||||||
|
// remove leading slash
|
||||||
|
if (filename.size() > 0 && filename[0] == '/')
|
||||||
|
filename.deleteChar(0);
|
||||||
|
|
||||||
// if archive hidden file is requested, ignore
|
// if archive hidden file is requested, ignore
|
||||||
if (filename.size() && filename[0] == '.')
|
if (filename.size() > 0 && filename[0] == '.')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// if file not found, don't set handler either
|
// if file not found, don't set handler either
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue