Skip to content

Commit

Permalink
Refix use-after-free
Browse files Browse the repository at this point in the history
  • Loading branch information
bapt committed Feb 27, 2023
1 parent 1c53e08 commit 6c55d7b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 0 additions & 1 deletion libpkg/pkg_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,6 @@ pkg_ini(const char *path, const char *reposdir, pkg_init_flags flags)
ucl_object_replace_key(config, ucl_object_ref(cur), key, strlen(key), true);
}
}
ucl_object_unref(ncfg);
ncfg = NULL;
it = NULL;
while ((cur = ucl_iterate_object(config, &it, true))) {
Expand Down
16 changes: 15 additions & 1 deletion tests/frontend/pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ tests_init \
pkg_no_database \
pkg_config_defaults \
pkg_create_manifest_bad_syntax \
pkg_repo_load_order
pkg_repo_load_order \
double_entry

pkg_no_database_body() {
atf_skip_on Linux Test fails on Linux
Expand Down Expand Up @@ -87,3 +88,16 @@ pkg_repo_load_order_body()
-s exit:0 \
echo $out
}

double_entry_body()
{
cat >> pkg.conf <<EOF
pkg_env {}
PKG_ENV : {
http_proxy: "http://10.0.0.1:3128"
https_proxy: "http://10.0.0.1:3128"
ftp_proxy: "http://10.0.0.1:3128"
}
EOF
atf_check -o ignore pkg -C ./pkg.conf -vv
}

0 comments on commit 6c55d7b

Please sign in to comment.