From eb75eb0e55d135d8244ae59fe98a8664fe075e25 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 26 Oct 2022 18:35:56 -0400 Subject: [PATCH] reset port value before parsing --- libi2pd/HTTP.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libi2pd/HTTP.cpp b/libi2pd/HTTP.cpp index e994b9b3..8791eadb 100644 --- a/libi2pd/HTTP.cpp +++ b/libi2pd/HTTP.cpp @@ -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 * @@ -135,6 +135,7 @@ namespace http ? url.substr(pos_p, std::string::npos) : url.substr(pos_p, pos_c - pos_p); /* stoi throws exception on failure, we don't need it */ + port = 0; for (char c : port_str) { if (c < '0' || c > '9') return false;