Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetRocks: fix incorrect password parsing in SplitLocationSpecification() #2543

Conversation

spnethw
Copy link
Contributor

@spnethw spnethw commented Dec 3, 2024

В коде разбора URL

const char *at = strchr(proto_end, '@');
if (at) {
username.assign(proto_end, at - proto_end);
size_t up_div = username.find(':');
if (up_div!=std::string::npos) {
password = username.substr(up_div);
username.resize(up_div);
}

к паролю в начале цепляется лишний символ двоеточия, из-за чего набранные в командной строке адреса вида
ftp://johndoe:[email protected]:12345
вызывают показ окна авторизации с просьбой ввести логин с паролем заново.

Фикс простой, но не уверен, что какой-то другой код не полагается на такой (неправильный) парсинг.

@elfmz elfmz merged commit 915965c into elfmz:master Dec 4, 2024
9 checks passed
@spnethw spnethw deleted the netrocks_fix_incorrect_password_parsing_in_splitlocationspecification branch December 4, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants