Closed jrohel closed 1 year ago
@jrohel Hi, has this problem been solved? Is there any reproduction code?
@xiaoge1001
has this problem been solved?
Yes, in this PR https://github.com/rpm-software-management/librepo/pull/277
Is there any reproduction code?
To reproduce the error, you need to call the lr gpg list_keys
librepo API function where the home_dir
parameter points to an empty directory. Or a directory containing an empty keyring.
The lr gpg list_keys
function is used by the libdnf5
library and therefore the dnf5
application can be used to reproduce the error.
The older library libdnf
(and thus the application dnf, microdnf, PackageKit, ...) does not use this function yet, it assumes that librepo uses GpgME and accesses the keyring directly via the GpgME library. So they cannot be used for reproduction.
A simple reproducer:
repo_gpgcheck=1
(e.g. google-chrome)/var/cache/libdnf5/<repo_cache_dir>/pubring/
)lr gpg list_keys
function on an empty directory (contains 0 keys)I am closing the issue. It is fixed by PR https://github.com/rpm-software-management/librepo/pull/277
Error in line:
for (guint i = 0; i < keys->len - 1; ++i) {
keys->len
is unsigned. For empty keyringkeys->len == 0
.0 - 1
is max value for unsigned type.