mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
reset port value before parsing
This commit is contained in:
parent
2a703e0844
commit
eb75eb0e55
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2021, The PurpleI2P Project
|
* Copyright (c) 2013-2022, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
@ -135,6 +135,7 @@ namespace http
|
|||||||
? url.substr(pos_p, std::string::npos)
|
? url.substr(pos_p, std::string::npos)
|
||||||
: url.substr(pos_p, pos_c - pos_p);
|
: url.substr(pos_p, pos_c - pos_p);
|
||||||
/* stoi throws exception on failure, we don't need it */
|
/* stoi throws exception on failure, we don't need it */
|
||||||
|
port = 0;
|
||||||
for (char c : port_str) {
|
for (char c : port_str) {
|
||||||
if (c < '0' || c > '9')
|
if (c < '0' || c > '9')
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user