Skip to content

Commit

Permalink
Apps: Avoid use of uninitialized access token
Browse files Browse the repository at this point in the history
  • Loading branch information
alerei committed Jan 19, 2024
1 parent 24b9818 commit dba26b9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions daemon/modules/apps/src/impl/apps_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,7 @@ auto apps_t::do_install_impl(
auto docker_logout_process = process_t{};

progress.next_step("Authenticating");
if (!token->username().empty() && !token->password().empty()) {
const auto repo = app->manifest()->image_with_tag().substr(
0,
app->manifest()->image_with_tag().find_last_of('/'));

if (token.has_value() && !token->username().empty() && !token->password().empty()) {
auto docker_process = process_t{};

auto login_attempts = 3;
Expand All @@ -290,7 +286,7 @@ auto apps_t::do_install_impl(
token->username(),
"--password",
token->password(),
std::move(repo));
app->manifest()->image_with_tag());
docker_process.wait(true, true);
if (docker_process.exit_code() == 0) {
break;
Expand Down

0 comments on commit dba26b9

Please # to comment.