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

Fix segfault in repo_internalize_trigger (RhBug:1375895) #596

Merged
merged 1 commit into from Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions libdnf/hy-package.cpp
Expand Up @@ -316,9 +316,7 @@ const char *
dnf_package_get_location(DnfPackage *pkg)
{
Solvable *s = get_solvable(pkg);
if (s->repo) {
repo_internalize_trigger(s->repo);
}
repo_internalize_trigger(s->repo);
return solvable_get_location(s, NULL);
}

Expand Down
14 changes: 8 additions & 6 deletions libdnf/hy-repo.cpp
Expand Up @@ -55,12 +55,14 @@ repo_internalize_all_trigger(Pool *pool)
void
repo_internalize_trigger(Repo * repo)
{
auto hrepo = static_cast<HyRepo>(repo->appdata);
assert(hrepo->libsolv_repo == repo);
if (!hrepo->needs_internalizing)
return;
hrepo->needs_internalizing = 0;
repo_internalize(repo);
if (repo) {
auto hrepo = static_cast<HyRepo>(repo->appdata);
assert(hrepo->libsolv_repo == repo);
if (!hrepo->needs_internalizing)
return;
hrepo->needs_internalizing = 0;
repo_internalize(repo);
}
}

void
Expand Down