mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Game server: Reject bad URLs
This commit is contained in:
parent
b22b54b636
commit
989b564fa4
1 changed files with 4 additions and 0 deletions
|
@ -16,6 +16,10 @@ void Url::Split() {
|
|||
protocol_ = url_.substr(0, colonSlashSlash);
|
||||
|
||||
size_t sep = url_.find('/', colonSlashSlash + 3);
|
||||
if (sep == std::string::npos) {
|
||||
valid_ = false;
|
||||
return;
|
||||
}
|
||||
|
||||
host_ = url_.substr(colonSlashSlash + 3, sep - colonSlashSlash - 3);
|
||||
resource_ = url_.substr(sep); // include the slash!
|
||||
|
|
Loading…
Add table
Reference in a new issue