Skip to content

Commit

Permalink
libpkg: don't recurse on pkg_jobs_universe_process_deps for local pkgs
Browse files Browse the repository at this point in the history
This can be reproduced by simply trying to `pkg install` a .pkg out of
/var/cache/pkg.  libpkg ends up blowing up the stack here and crashing,
because it wants to fetch the local package but it's already been presented
with the local package.

Simply stop doing that. This now attempts to install the latest version of
the named packaged from the remote.
  • Loading branch information
kevans91 authored and bapt committed Sep 24, 2021
1 parent 4ffdaa3 commit 8bc29df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libpkg/pkg_jobs_universe.c
Expand Up @@ -251,7 +251,7 @@ pkg_jobs_universe_process_deps(struct pkg_jobs_universe *universe,
pkg_debug(4, "Processing rdeps for %s (%s)", pkg->uid, pkg->type == PKG_INSTALLED ? "installed" : "remote");
if (pkg->type != PKG_INSTALLED) {
lpkg = pkg_jobs_universe_get_local(universe, pkg->uid, 0);
if (lpkg != NULL)
if (lpkg != NULL && lpkg != pkg)
return (pkg_jobs_universe_process_deps(universe, lpkg, flags));
}
deps_func = pkg_rdeps;
Expand Down

0 comments on commit 8bc29df

Please sign in to comment.