xbps_package_remove: use xbps_set_pkg_state_dictionary().

fixes a use-after-free found by @duncaen via gcc -fsanitize=address.
This commit is contained in:
Juan RP 2019-06-18 20:55:47 +02:00
parent 829c5835f1
commit 6627ffb84f
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368

View File

@ -422,7 +422,7 @@ xbps_remove_pkg(struct xbps_handle *xhp, const char *pkgver, bool update)
/*
* Set package state to "half-removed".
*/
rv = xbps_set_pkg_state_installed(xhp, pkgver,
rv = xbps_set_pkg_state_dictionary(pkgd,
XBPS_PKG_STATE_HALF_REMOVED);
if (rv != 0) {
xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_FAIL,