[pacman-dev] [PATCH 1/2] libalpm: fix segfault when -Qip'ing a package

morganamilo morganamilo at gmail.com
Tue Oct 15 08:58:48 UTC 2019


The dummy checksigs function never sets count to 0, leaving it
unitialized. This caused the siglist cleanup to try and free the empty
list.

diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index 30d057a3..4cb31e7c 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -802,6 +802,7 @@ int _alpm_key_import(alpm_handle_t UNUSED *handle, const char UNUSED *uid,
 int _alpm_gpgme_checksig(alpm_handle_t UNUSED *handle, const char UNUSED *path,
 		const char UNUSED *base64_sig, alpm_siglist_t UNUSED *siglist)
 {
+	siglist->count = 0;
 	return -1;
 }
 #endif /* HAVE_LIBGPGME */
-- 
2.23.0


More information about the pacman-dev mailing list