aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-03-24 15:17:50 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-03-24 15:17:50 +0300
commitb4179919e9456784d91e3ce2766c734213fe2945 (patch)
treec0c65699c804976dc496fffadaa608b2af3cec8e
parentff2ac78130e283ecacf485b5ba1b7674281dc38b (diff)
Fix process::path_search() calls to prevent leakage of local variable addresses
-rw-r--r--bpkg/system-package-manager-debian.cxx8
-rw-r--r--bpkg/system-package-manager-fedora.cxx8
2 files changed, 8 insertions, 8 deletions
diff --git a/bpkg/system-package-manager-debian.cxx b/bpkg/system-package-manager-debian.cxx
index ca44658..b06487f 100644
--- a/bpkg/system-package-manager-debian.cxx
+++ b/bpkg/system-package-manager-debian.cxx
@@ -256,7 +256,7 @@ namespace bpkg
try
{
if (apt_cache_path.empty () && !simulate_)
- apt_cache_path = process::path_search (args[0]);
+ apt_cache_path = process::path_search (args[0], false /* init */);
process_env pe (apt_cache_path, evars);
@@ -476,7 +476,7 @@ namespace bpkg
try
{
if (apt_cache_path.empty () && !simulate_)
- apt_cache_path = process::path_search (args[0]);
+ apt_cache_path = process::path_search (args[0], false /* init */);
process_env pe (apt_cache_path, evars);
@@ -749,14 +749,14 @@ namespace bpkg
if (!sudo_.empty ())
{
if (sudo_path.empty () && !simulate_)
- sudo_path = process::path_search (args[0]);
+ sudo_path = process::path_search (args[0], false /* init */);
pp = &sudo_path;
}
else
{
if (apt_get_path.empty () && !simulate_)
- apt_get_path = process::path_search (args[0]);
+ apt_get_path = process::path_search (args[0], false /* init */);
pp = &apt_get_path;
}
diff --git a/bpkg/system-package-manager-fedora.cxx b/bpkg/system-package-manager-fedora.cxx
index 873f9c9..a504035 100644
--- a/bpkg/system-package-manager-fedora.cxx
+++ b/bpkg/system-package-manager-fedora.cxx
@@ -248,7 +248,7 @@ namespace bpkg
try
{
if (dnf_path.empty () && !simulate_)
- dnf_path = process::path_search (args[0]);
+ dnf_path = process::path_search (args[0], false /* init */);
process_env pe (dnf_path, evars);
@@ -605,7 +605,7 @@ namespace bpkg
try
{
if (dnf_path.empty () && !simulate_)
- dnf_path = process::path_search (args[0]);
+ dnf_path = process::path_search (args[0], false /* init */);
process_env pe (dnf_path, evars);
@@ -829,14 +829,14 @@ namespace bpkg
if (!sudo_.empty ())
{
if (sudo_path.empty () && !simulate_)
- sudo_path = process::path_search (args[0]);
+ sudo_path = process::path_search (args[0], false /* init */);
pp = &sudo_path;
}
else
{
if (dnf_path.empty () && !simulate_)
- dnf_path = process::path_search (args[0]);
+ dnf_path = process::path_search (args[0], false /* init */);
pp = &dnf_path;
}